Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -0,0 +1,36 @@
using System;
using System.Diagnostics;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
internal partial class Interop
{
static class MonoGetRandomBytesFallback
{
static object _rngAccess = new object ();
static RNGCryptoServiceProvider _rng;
internal static void GetRandomBytes (byte[] buffer)
{
lock (_rngAccess) {
if (_rng == null)
_rng = new RNGCryptoServiceProvider ();
_rng.GetBytes (buffer);
}
}
internal static unsafe void GetRandomBytes (byte* buffer, int length)
{
lock (_rngAccess) {
if (_rng == null)
_rng = new RNGCryptoServiceProvider ();
_rng.GetBytes (buffer, (IntPtr)length);
}
}
}
internal static unsafe void GetRandomBytes (byte* buffer, int length)
{
MonoGetRandomBytesFallback.GetRandomBytes (buffer, length);
}
}

View File

@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Win32.SafeHandles
{
partial class SafePasswordHandle
{
internal string Mono_DangerousGetString ()
{
return Marshal.PtrToStringAnsi (DangerousGetHandle ());
}
}
}

View File

@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Win32.SafeHandles
{
partial class SafePasswordHandle
{
internal string Mono_DangerousGetString ()
{
return Marshal.PtrToStringUni (DangerousGetHandle ());
}
}
}

View File

@ -36,7 +36,7 @@ using nuint = System.UInt32;
namespace System.Runtime
{
static class RuntimeImports
static partial class RuntimeImports
{
internal static unsafe void RhZeroMemory (ref byte b, nuint byteLength)
{

View File

@ -1 +1 @@
8ece558dd28f5a3fe538b92be0dd6563dea791da
7d6c3d757b2553412e786d3044d3e3d62c801369

View File

@ -0,0 +1,6 @@
partial class SR
{
public const string ArgumentOutOfRange_ConsoleKey = "Console key values must be between 0 and 255 inclusive.";
public const string Arg_InvalidComObjectException = "Attempt has been made to use a COM object that does not have a backing class factory.";
public const string Arg_MustBeNullTerminatedString = "The string must be null-terminated.";
}

View File

@ -0,0 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Text;
namespace System.Globalization
{
partial class TimeSpanParse
{
internal static void ValidateStyles (TimeSpanStyles style, String parameterName)
{
if (style != TimeSpanStyles.None && style != TimeSpanStyles.AssumeNegative)
throw new ArgumentException (Environment.GetResourceString ("Argument_InvalidTimeSpanStyles"), parameterName);
}
}
}