From: Dan Moseley Date: Fri, 24 Mar 2017 06:47:38 +0000 (-0700) Subject: Add PNSE messages (dotnet/coreclr#10440) X-Git-Tag: submit/tizen/20210909.063632~11030^2~7570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e9067f4d5af84269c596e1552bc19f380aa1fa3;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add PNSE messages (dotnet/coreclr#10440) * PNSE messages * threading * marshal * interop svc * More * more * Remove env var special casing for UWP * Pending question * remove pinvoke Commit migrated from https://github.com/dotnet/coreclr/commit/ad746a9b698c3cd5f603db8974a196dfcbc10267 --- diff --git a/src/coreclr/src/mscorlib/Resources/Strings.resx b/src/coreclr/src/mscorlib/Resources/Strings.resx index c9f8a63..9cd76eb 100644 --- a/src/coreclr/src/mscorlib/Resources/Strings.resx +++ b/src/coreclr/src/mscorlib/Resources/Strings.resx @@ -1,64 +1,5 @@  - @@ -4361,6 +4302,12 @@ MoveNext must be called at least once before calling Current. + + ArgIterator is not supported on this platform. + + + COM Interop is not supported on this platform. + The named version of this synchronization primitive is not supported on this platform. @@ -4373,6 +4320,9 @@ ReflectionOnly loading is not supported on this platform. + + Remoting is not supported on this platform. + This operation is only supported on Windows Vista and above. @@ -4382,6 +4332,12 @@ This operation is only supported on Windows 2000 SP3 or later operating systems. + + Secure binary serialization is not supported on this platform. + + + Strong name signing is not supported on this platform. + Windows Runtime is not supported on this operating system. diff --git a/src/coreclr/src/mscorlib/shared/System/MarshalByRefObject.cs b/src/coreclr/src/mscorlib/shared/System/MarshalByRefObject.cs index 9014de0..1f1739b 100644 --- a/src/coreclr/src/mscorlib/shared/System/MarshalByRefObject.cs +++ b/src/coreclr/src/mscorlib/shared/System/MarshalByRefObject.cs @@ -13,12 +13,12 @@ namespace System public object GetLifetimeService() { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_Remoting); } public virtual object InitializeLifetimeService() { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_Remoting); } protected MarshalByRefObject MemberwiseClone(bool cloneIdentity) diff --git a/src/coreclr/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs b/src/coreclr/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs index 8d2bf1f..c04ddd6 100644 --- a/src/coreclr/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs +++ b/src/coreclr/src/mscorlib/shared/System/Reflection/StrongNameKeyPair.cs @@ -50,14 +50,14 @@ namespace System.Reflection public StrongNameKeyPair(string keyPairContainer) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_StrongNameSigning); } public byte[] PublicKey { get { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_StrongNameSigning); } } diff --git a/src/coreclr/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/coreclr/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index c571f06..8408937 100644 --- a/src/coreclr/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/coreclr/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -815,9 +815,6 @@ namespace Microsoft.Win32 [DllImport(KERNEL32, CharSet = CharSet.Auto, SetLastError = true)] internal static extern uint GetCurrentProcessId(); - [DllImport(KERNEL32, CharSet = CharSet.Auto, BestFitMapping = false)] - internal extern static int GetComputerName([Out]StringBuilder nameBuffer, ref int bufferSize); - [DllImport(OLE32)] internal extern static int CoCreateGuid(out Guid guid); diff --git a/src/coreclr/src/mscorlib/src/System/ArgIterator.cs b/src/coreclr/src/mscorlib/src/System/ArgIterator.cs index b608e7e..584f85f 100644 --- a/src/coreclr/src/mscorlib/src/System/ArgIterator.cs +++ b/src/coreclr/src/mscorlib/src/System/ArgIterator.cs @@ -136,50 +136,50 @@ namespace System #else public ArgIterator(RuntimeArgumentHandle arglist) { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } [CLSCompliant(false)] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } public void End() { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } public override bool Equals(Object o) { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } public override int GetHashCode() { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } [System.CLSCompliantAttribute(false)] public System.TypedReference GetNextArg() { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } [System.CLSCompliantAttribute(false)] public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } public unsafe System.RuntimeTypeHandle GetNextArgType() { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } public int GetRemainingCount() { - throw new PlatformNotSupportedException(); //The JIT requires work to enable ArgIterator see: https://github.com/dotnet/coreclr/issues/9204. + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 } #endif //VARARGS_ENABLED } diff --git a/src/coreclr/src/mscorlib/src/System/Environment.cs b/src/coreclr/src/mscorlib/src/System/Environment.cs index 911b5b1..453583b 100644 --- a/src/coreclr/src/mscorlib/src/System/Environment.cs +++ b/src/coreclr/src/mscorlib/src/System/Environment.cs @@ -180,13 +180,6 @@ namespace System return name; } - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXDesignMode()) - { - // Environment variable accessors are not approved modern API. - // Behave as if no variables are defined in this case. - return name; - } - int currentSize = 100; StringBuilder blob = new StringBuilder(currentSize); // A somewhat reasonable default size @@ -233,27 +226,6 @@ namespace System return blob.ToString(); } - public static String MachineName - { - get - { - // UWP Debug scenarios - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXDesignMode()) - { - // Getting Computer Name is not a supported scenario on Store apps. - throw new PlatformNotSupportedException(); - } - - // In future release of operating systems, you might be able to rename a machine without - // rebooting. Therefore, don't cache this machine name. - StringBuilder buf = new StringBuilder(MaxMachineNameLength); - int len = MaxMachineNameLength; - if (Win32Native.GetComputerName(buf, ref len) == 0) - throw new InvalidOperationException(SR.InvalidOperation_ComputerName); - return buf.ToString(); - } - } - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [SuppressUnmanagedCodeSecurity] private static extern Int32 GetProcessorCount(); @@ -701,13 +673,6 @@ namespace System private static string GetEnvironmentVariableCore(string variable) { - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXDesignMode()) - { - // Environment variable accessors are not approved modern API. - // Behave as if the variable was not found in this case. - return null; - } - StringBuilder sb = StringBuilderCache.Acquire(128); // A somewhat reasonable default size int requiredSize = Win32Native.GetEnvironmentVariable(variable, sb, sb.Capacity); @@ -763,13 +728,6 @@ namespace System private static IDictionary GetEnvironmentVariablesCore() { - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXDesignMode()) - { - // Environment variable accessors are not approved modern API. - // Behave as if no environment variables are defined in this case. - return new Dictionary(0); - } - return GetRawEnvironmentVariables(); } @@ -821,13 +779,6 @@ namespace System if (string.IsNullOrEmpty(value) || value[0] == '\0') value = null; - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXDesignMode()) - { - // Environment variable accessors are not approved modern API. - // so we throw PlatformNotSupportedException. - throw new PlatformNotSupportedException(); - } - if (!Win32Native.SetEnvironmentVariable(variable, value)) { int errorCode = Marshal.GetLastWin32Error(); diff --git a/src/coreclr/src/mscorlib/src/System/Exception.cs b/src/coreclr/src/mscorlib/src/System/Exception.cs index 096bee2..61e8a41 100644 --- a/src/coreclr/src/mscorlib/src/System/Exception.cs +++ b/src/coreclr/src/mscorlib/src/System/Exception.cs @@ -520,8 +520,8 @@ namespace System protected event EventHandler SerializeObjectState { - add { throw new PlatformNotSupportedException(); } - remove { throw new PlatformNotSupportedException(); } + add { throw new PlatformNotSupportedException(SR.PlatformNotSupported_SecureBinarySerialization); } + remove { throw new PlatformNotSupportedException(SR.PlatformNotSupported_SecureBinarySerialization); } } public virtual void GetObjectData(SerializationInfo info, StreamingContext context) diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 306d889..248e0d5 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -408,7 +408,7 @@ namespace System.Runtime.InteropServices //==================================================================== public static byte ReadByte([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static unsafe byte ReadByte(IntPtr ptr, int ofs) @@ -432,7 +432,7 @@ namespace System.Runtime.InteropServices public static short ReadInt16([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static unsafe short ReadInt16(IntPtr ptr, int ofs) @@ -469,7 +469,7 @@ namespace System.Runtime.InteropServices public static int ReadInt32([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static unsafe int ReadInt32(IntPtr ptr, int ofs) @@ -535,7 +535,7 @@ namespace System.Runtime.InteropServices public static long ReadInt64([MarshalAs(UnmanagedType.AsAny), In] Object ptr, int ofs) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static unsafe long ReadInt64(IntPtr ptr, int ofs) @@ -596,7 +596,7 @@ namespace System.Runtime.InteropServices public static void WriteByte([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, byte val) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static void WriteByte(IntPtr ptr, byte val) @@ -631,7 +631,7 @@ namespace System.Runtime.InteropServices public static void WriteInt16([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, short val) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static void WriteInt16(IntPtr ptr, short val) @@ -683,7 +683,7 @@ namespace System.Runtime.InteropServices public static void WriteInt32([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, int val) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static void WriteInt32(IntPtr ptr, int val) @@ -751,7 +751,7 @@ namespace System.Runtime.InteropServices public static void WriteInt64([MarshalAs(UnmanagedType.AsAny), In, Out] Object ptr, int ofs, long val) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10442 } public static void WriteInt64(IntPtr ptr, long val) @@ -1470,7 +1470,7 @@ namespace System.Runtime.InteropServices //==================================================================== public static Object GetComObjectData(Object obj, Object key) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); } //==================================================================== @@ -1481,7 +1481,7 @@ namespace System.Runtime.InteropServices //==================================================================== public static bool SetComObjectData(Object obj, Object key, Object data) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); } #if FEATURE_COMINTEROP @@ -1772,7 +1772,7 @@ namespace System.Runtime.InteropServices #if FEATURE_COMINTEROP return s.MarshalToBSTR(); #else - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(); // https://github.com/dotnet/coreclr/issues/10443 #endif } diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs index ae97446..7b7c5ef 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs @@ -15,7 +15,7 @@ namespace System.Runtime.InteropServices public static int AddRef(System.IntPtr pUnk) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static bool AreComObjectsAvailableForCleanup() @@ -25,12 +25,12 @@ namespace System.Runtime.InteropServices public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static Object BindToMoniker(String monikerName) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static void CleanupUnusedObjectsInCurrentContext() @@ -40,42 +40,42 @@ namespace System.Runtime.InteropServices public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, T o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static object CreateWrapperOfType(object o, System.Type t) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static TWrapper CreateWrapperOfType(T o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static void ChangeWrapperHandleStrength(Object otp, bool fIsWeak) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static int FinalReleaseComObject(object o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.IntPtr GetComInterfaceForObject(T o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) @@ -89,67 +89,67 @@ namespace System.Runtime.InteropServices public static System.IntPtr GetIUnknownForObject(object o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static void GetNativeVariantForObject(object obj, System.IntPtr pDstNativeVariant) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static void GetNativeVariantForObject(T obj, System.IntPtr pDstNativeVariant) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static Object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static object GetObjectForIUnknown(System.IntPtr pUnk) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static object GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static T GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static object[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static T[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static int GetStartComSlot(System.Type t) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.Type GetTypeFromCLSID(System.Guid clsid) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static bool IsComObject(object o) @@ -159,22 +159,22 @@ namespace System.Runtime.InteropServices public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static int Release(System.IntPtr pUnk) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static int ReleaseComObject(object o) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static void ZeroFreeBSTR(System.IntPtr s) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } } @@ -182,14 +182,14 @@ namespace System.Runtime.InteropServices { public DispatchWrapper(object obj) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public object WrappedObject { get { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } } } @@ -198,12 +198,12 @@ namespace System.Runtime.InteropServices { public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } public static System.Delegate Remove(object rcw, System.Guid iid, int dispid, System.Delegate d) { - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); } } } diff --git a/src/coreclr/src/mscorlib/src/System/Threading/WaitHandle.cs b/src/coreclr/src/mscorlib/src/System/Threading/WaitHandle.cs index 50b277f..97b9ff2 100644 --- a/src/coreclr/src/mscorlib/src/System/Threading/WaitHandle.cs +++ b/src/coreclr/src/mscorlib/src/System/Threading/WaitHandle.cs @@ -448,7 +448,7 @@ namespace System.Threading WaitHandle toWaitOn) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // https://github.com/dotnet/coreclr/issues/10441 #else return SignalAndWait(toSignal, toWaitOn, -1, false); #endif @@ -461,7 +461,7 @@ namespace System.Threading bool exitContext) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // https://github.com/dotnet/coreclr/issues/10441 #else long tm = (long)timeout.TotalMilliseconds; if (-1 > tm || (long)Int32.MaxValue < tm) @@ -480,7 +480,7 @@ namespace System.Threading bool exitContext) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(); + throw new PlatformNotSupportedException(SR.Arg_PlatformNotSupported); // https://github.com/dotnet/coreclr/issues/10441 #else if (null == toSignal) {