From 463b62f9396f5c05b2eb37e90b76b034c8f555e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20K=C3=B6plinger?= Date: Sat, 25 Jan 2020 11:08:02 +0100 Subject: [PATCH] Move Strings.resx from CoreCLR to shared System.Private.CoreLib folder (#2151) * Move Strings.resx from CoreCLR to shared System.Private.CoreLib folder Mono and CoreCLR both use the same file. * Get rid of duplicate string --- .../System.Private.CoreLib.csproj | 3 +- .../src}/Resources/Strings.resx | 3 ++ .../src/System.Private.CoreLib.Shared.projitems | 1 + .../System.Private.CoreLib/src/System/SR.cs | 0 .../ThreadPoolBoundHandle.PlatformNotSupported.cs | 10 ++--- .../System.Private.CoreLib.csproj | 7 +-- .../System.Private.CoreLib/resources/SR.extra.cs | 12 ------ .../src/Microsoft/Win32/UnsafeNativeMethods.cs | 50 ---------------------- 8 files changed, 11 insertions(+), 75 deletions(-) rename src/{coreclr/src/System.Private.CoreLib => libraries/System.Private.CoreLib/src}/Resources/Strings.resx (99%) rename src/{coreclr/src => libraries}/System.Private.CoreLib/src/System/SR.cs (100%) delete mode 100644 src/mono/netcore/System.Private.CoreLib/resources/SR.extra.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/Microsoft/Win32/UnsafeNativeMethods.cs diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 24f8495..ef7df51 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -24,7 +24,7 @@ - + true System.SR @@ -261,7 +261,6 @@ - diff --git a/src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx similarity index 99% rename from src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx rename to src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index e163e2f..72cf637 100644 --- a/src/coreclr/src/System.Private.CoreLib/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -3301,6 +3301,9 @@ The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length. + + Setter must have parameters. + The calling thread does not hold the lock. diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 50c33f4..f7029d5 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -771,6 +771,7 @@ + diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/SR.cs b/src/libraries/System.Private.CoreLib/src/System/SR.cs similarity index 100% rename from src/coreclr/src/System.Private.CoreLib/src/System/SR.cs rename to src/libraries/System.Private.CoreLib/src/System/SR.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.PlatformNotSupported.cs index e71a90e..e97b1e9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.PlatformNotSupported.cs @@ -26,7 +26,7 @@ namespace System.Threading if (handle.IsClosed || handle.IsInvalid) throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle)); - throw new PlatformNotSupportedException(SR.NotSupported_Overlapped); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } [CLSCompliant(false)] @@ -35,7 +35,7 @@ namespace System.Threading if (callback == null) throw new ArgumentNullException(nameof(callback)); - throw new PlatformNotSupportedException(SR.NotSupported_Overlapped); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } [CLSCompliant(false)] @@ -44,7 +44,7 @@ namespace System.Threading if (preAllocated == null) throw new ArgumentNullException(nameof(preAllocated)); - throw new PlatformNotSupportedException(SR.NotSupported_Overlapped); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } [CLSCompliant(false)] @@ -53,7 +53,7 @@ namespace System.Threading if (overlapped == null) throw new ArgumentNullException(nameof(overlapped)); - throw new PlatformNotSupportedException(SR.NotSupported_Overlapped); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } [CLSCompliant(false)] @@ -62,7 +62,7 @@ namespace System.Threading if (overlapped == null) throw new ArgumentNullException(nameof(overlapped)); - throw new PlatformNotSupportedException(SR.NotSupported_Overlapped); + throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); } public void Dispose() diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 97c177b..d599a23 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -26,7 +26,7 @@ - + true System.SR @@ -144,11 +144,6 @@ - - - - - diff --git a/src/mono/netcore/System.Private.CoreLib/resources/SR.extra.cs b/src/mono/netcore/System.Private.CoreLib/resources/SR.extra.cs deleted file mode 100644 index d20808d..0000000 --- a/src/mono/netcore/System.Private.CoreLib/resources/SR.extra.cs +++ /dev/null @@ -1,12 +0,0 @@ -// -// Extra resources not available in coreclr Strings.resx -// - -namespace System -{ - partial class SR - { - public const string SetterHasNoParams = "Setter must have parameters."; - public const string NotSupported_Overlapped = "This API is not supported on this platform."; - } -} \ No newline at end of file diff --git a/src/mono/netcore/System.Private.CoreLib/src/Microsoft/Win32/UnsafeNativeMethods.cs b/src/mono/netcore/System.Private.CoreLib/src/Microsoft/Win32/UnsafeNativeMethods.cs deleted file mode 100644 index aa57db9..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/Microsoft/Win32/UnsafeNativeMethods.cs +++ /dev/null @@ -1,50 +0,0 @@ -// 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; - -namespace Microsoft.Win32 -{ - static class UnsafeNativeMethods - { - internal static unsafe class ManifestEtw - { - internal unsafe delegate void EtwEnableCallback( - [In] ref Guid sourceId, - [In] int isEnabled, - [In] byte level, - [In] long matchAnyKeywords, - [In] long matchAllKeywords, - [In] EVENT_FILTER_DESCRIPTOR* filterData, - [In] void* callbackContext - ); - - [StructLayout(LayoutKind.Sequential)] - unsafe internal struct EVENT_FILTER_DESCRIPTOR - { - public long Ptr; - public int Size; - public int Type; - } - - internal enum ActivityControl : uint - { - EVENT_ACTIVITY_CTRL_GET_ID = 1, - EVENT_ACTIVITY_CTRL_SET_ID = 2, - EVENT_ACTIVITY_CTRL_CREATE_ID = 3, - EVENT_ACTIVITY_CTRL_GET_SET_ID = 4, - EVENT_ACTIVITY_CTRL_CREATE_SET_ID = 5 - } - - internal const int ERROR_ARITHMETIC_OVERFLOW = 534; - internal const int ERROR_NOT_ENOUGH_MEMORY = 8; - internal const int ERROR_MORE_DATA = 0xEA; - - internal const int EVENT_CONTROL_CODE_DISABLE_PROVIDER = 0; - internal const int EVENT_CONTROL_CODE_ENABLE_PROVIDER = 1; - internal const int EVENT_CONTROL_CODE_CAPTURE_STATE = 2; - } - } -} -- 2.7.4