diff options
Diffstat (limited to 'netcore/System.Private.CoreLib/shared/Interop/Windows')
134 files changed, 0 insertions, 3464 deletions
diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.ActivityControl.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.ActivityControl.cs deleted file mode 100644 index 093755659de..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.ActivityControl.cs +++ /dev/null @@ -1,18 +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. - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - 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 - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EVENT_INFO_CLASS.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EVENT_INFO_CLASS.cs deleted file mode 100644 index fae4d2e5c30..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EVENT_INFO_CLASS.cs +++ /dev/null @@ -1,16 +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. - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - internal enum EVENT_INFO_CLASS - { - BinaryTrackInfo, - SetEnableAllKeywords, - SetTraits, - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EtwEnableCallback.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EtwEnableCallback.cs deleted file mode 100644 index 33f6ae631d9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EtwEnableCallback.cs +++ /dev/null @@ -1,33 +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; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - 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; - - [StructLayout(LayoutKind.Sequential)] - internal struct EVENT_FILTER_DESCRIPTOR - { - public long Ptr; - public int Size; - public int Type; - } - - internal unsafe delegate void EtwEnableCallback( - in Guid sourceId, - int isEnabled, - byte level, - long matchAnyKeywords, - long matchAllKeywords, - EVENT_FILTER_DESCRIPTOR* filterData, - void* callbackContext); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs deleted file mode 100644 index 2d73e3e50a7..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventRegister.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventRegister.cs deleted file mode 100644 index 1c1af36bfc0..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventRegister.cs +++ /dev/null @@ -1,19 +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; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe uint EventRegister( - in Guid providerId, - EtwEnableCallback enableCallback, - void* callbackContext, - ref long registrationHandle); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventSetInformation.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventSetInformation.cs deleted file mode 100644 index b3a8851428c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventSetInformation.cs +++ /dev/null @@ -1,18 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe int EventSetInformation( - long registrationHandle, - EVENT_INFO_CLASS informationClass, - void* eventInformation, - int informationLength); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs deleted file mode 100644 index d85b2e5ba5f..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs +++ /dev/null @@ -1,58 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - internal enum TRACE_QUERY_INFO_CLASS - { - TraceGuidQueryList, - TraceGuidQueryInfo, - TraceGuidQueryProcess, - TraceStackTracingInfo, - MaxTraceSetInfoClass - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TRACE_GUID_INFO - { - public int InstanceCount; - public int Reserved; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TRACE_PROVIDER_INSTANCE_INFO - { - public int NextOffset; - public int EnableCount; - public int Pid; - public int Flags; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TRACE_ENABLE_INFO - { - public int IsEnabled; - public byte Level; - public byte Reserved1; - public ushort LoggerId; - public int EnableProperty; - public int Reserved2; - public long MatchAnyKeyword; - public long MatchAllKeyword; - } - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe int EnumerateTraceGuidsEx( - TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, - void* InBuffer, - int InBufferSize, - void* OutBuffer, - int OutBufferSize, - out int ReturnLength); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventUnregister.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventUnregister.cs deleted file mode 100644 index 1943cb314e4..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventUnregister.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern uint EventUnregister(long registrationHandle); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteString.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteString.cs deleted file mode 100644 index 9c60558e129..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteString.cs +++ /dev/null @@ -1,18 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern int EventWriteString( - long registrationHandle, - byte level, - long keyword, - string msg); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs deleted file mode 100644 index 1bc116fdd66..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs +++ /dev/null @@ -1,49 +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; -#if ES_BUILD_STANDALONE -using Microsoft.Diagnostics.Tracing; -#else -using System.Diagnostics.Tracing; -#endif - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - /// <summary> - /// Call the ETW native API EventWriteTransfer and checks for invalid argument error. - /// The implementation of EventWriteTransfer on some older OSes (Windows 2008) does not accept null relatedActivityId. - /// So, for these cases we will retry the call with an empty Guid. - /// </summary> - internal static unsafe int EventWriteTransfer( - long registrationHandle, - in EventDescriptor eventDescriptor, - Guid* activityId, - Guid* relatedActivityId, - int userDataCount, - EventProvider.EventData* userData) - { - int HResult = EventWriteTransfer_PInvoke(registrationHandle, in eventDescriptor, activityId, relatedActivityId, userDataCount, userData); - if (HResult == Errors.ERROR_INVALID_PARAMETER && relatedActivityId == null) - { - Guid emptyGuid = Guid.Empty; - HResult = EventWriteTransfer_PInvoke(registrationHandle, in eventDescriptor, activityId, &emptyGuid, userDataCount, userData); - } - - return HResult; - } - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, EntryPoint = "EventWriteTransfer")] - private static extern unsafe int EventWriteTransfer_PInvoke( - long registrationHandle, - in EventDescriptor eventDescriptor, - Guid* activityId, - Guid* relatedActivityId, - int userDataCount, - EventProvider.EventData* userData); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs deleted file mode 100644 index a254e694af5..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs +++ /dev/null @@ -1,21 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern bool LookupAccountNameW( - string? lpSystemName, - ref char lpAccountName, - ref byte Sid, - ref uint cbSid, - ref char ReferencedDomainName, - ref uint cchReferencedDomainName, - out uint peUse); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCloseKey.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCloseKey.cs deleted file mode 100644 index c4a69448e03..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCloseKey.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32)] - internal static extern int RegCloseKey(IntPtr hKey); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs deleted file mode 100644 index bb9da06c11d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs +++ /dev/null @@ -1,31 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - // Note: RegCreateKeyEx won't set the last error on failure - it returns - // an error code if it fails. - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegCreateKeyExW")] - internal static extern int RegCreateKeyEx( - SafeRegistryHandle hKey, - string lpSubKey, - int Reserved, - string? lpClass, - int dwOptions, - int samDesired, - ref Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs, - out SafeRegistryHandle hkResult, - out int lpdwDisposition); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs deleted file mode 100644 index 487caf8b6d7..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs +++ /dev/null @@ -1,19 +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. - -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegDeleteKeyExW")] - internal static extern int RegDeleteKeyEx(SafeRegistryHandle hKey, string lpSubKey, int samDesired, int Reserved); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs deleted file mode 100644 index 43cf683c2bd..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs +++ /dev/null @@ -1,20 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegDeleteValueW")] - internal static extern int RegDeleteValue(SafeRegistryHandle hKey, string? lpValueName); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs deleted file mode 100644 index 11165cc91a9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs +++ /dev/null @@ -1,28 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumKeyExW")] - internal static extern unsafe int RegEnumKeyEx( - SafeRegistryHandle hKey, - int dwIndex, - char[] lpName, - ref int lpcbName, - int[]? lpReserved, - [Out] char[]? lpClass, - int[]? lpcbClass, - long[]? lpftLastWriteTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumValue.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumValue.cs deleted file mode 100644 index e2ab45dea19..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegEnumValue.cs +++ /dev/null @@ -1,29 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumValueW")] - internal static extern unsafe int RegEnumValue( - SafeRegistryHandle hKey, - int dwIndex, - char[] lpValueName, - ref int lpcbValueName, - IntPtr lpReserved_MustBeZero, - int[]? lpType, - byte[]? lpData, - int[]? lpcbData); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegFlushKey.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegFlushKey.cs deleted file mode 100644 index ccbecb60897..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegFlushKey.cs +++ /dev/null @@ -1,19 +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. - -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32)] - internal static extern int RegFlushKey(SafeRegistryHandle hKey); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs deleted file mode 100644 index 5f5b6b6e372..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs +++ /dev/null @@ -1,35 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegOpenKeyExW")] - internal static extern int RegOpenKeyEx( - SafeRegistryHandle hKey, - string? lpSubKey, - int ulOptions, - int samDesired, - out SafeRegistryHandle hkResult); - - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegOpenKeyExW")] - internal static extern int RegOpenKeyEx( - IntPtr hKey, - string? lpSubKey, - int ulOptions, - int samDesired, - out SafeRegistryHandle hkResult); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs deleted file mode 100644 index c2bb82fab56..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs +++ /dev/null @@ -1,34 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System; -using System.Runtime.InteropServices; -using System.Text; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryInfoKeyW")] - internal static extern int RegQueryInfoKey( - SafeRegistryHandle hKey, - [Out] char[]? lpClass, - int[]? lpcbClass, - IntPtr lpReserved_MustBeZero, - ref int lpcSubKeys, - int[]? lpcbMaxSubKeyLen, - int[]? lpcbMaxClassLen, - ref int lpcValues, - int[]? lpcbMaxValueNameLen, - int[]? lpcbMaxValueLen, - int[]? lpcbSecurityDescriptor, - int[]? lpftLastWriteTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs deleted file mode 100644 index 72b8aa8f7bc..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs +++ /dev/null @@ -1,53 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW")] - internal static extern int RegQueryValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int[]? lpReserved, - ref int lpType, - [Out] byte[]? lpData, - ref int lpcbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW")] - internal static extern int RegQueryValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int[]? lpReserved, - ref int lpType, - ref int lpData, - ref int lpcbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW")] - internal static extern int RegQueryValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int[]? lpReserved, - ref int lpType, - ref long lpData, - ref int lpcbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW")] - internal static extern int RegQueryValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int[]? lpReserved, - ref int lpType, - [Out] char[]? lpData, - ref int lpcbData); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs deleted file mode 100644 index 847d28fa1c5..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs +++ /dev/null @@ -1,62 +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. - -#nullable enable -#if REGISTRY_ASSEMBLY -using Microsoft.Win32.SafeHandles; -#else -using Internal.Win32.SafeHandles; -#endif -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegSetValueExW")] - internal static extern int RegSetValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int Reserved, - int dwType, - byte[]? lpData, - int cbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegSetValueExW")] - internal static extern int RegSetValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int Reserved, - int dwType, - char[]? lpData, - int cbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegSetValueExW")] - internal static extern int RegSetValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int Reserved, - int dwType, - ref int lpData, - int cbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegSetValueExW")] - internal static extern int RegSetValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int Reserved, - int dwType, - ref long lpData, - int cbData); - - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegSetValueExW")] - internal static extern int RegSetValueEx( - SafeRegistryHandle hKey, - string? lpValueName, - int Reserved, - int dwType, - string? lpData, - int cbData); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs deleted file mode 100644 index 48ea1f27c52..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs +++ /dev/null @@ -1,65 +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. - -internal static partial class Interop -{ - internal static partial class Advapi32 - { - internal static class RegistryOptions - { - internal const int REG_OPTION_NON_VOLATILE = 0x0000; // (default) keys are persisted beyond reboot/unload - internal const int REG_OPTION_VOLATILE = 0x0001; // All keys created by the function are volatile - internal const int REG_OPTION_CREATE_LINK = 0x0002; // They key is a symbolic link - internal const int REG_OPTION_BACKUP_RESTORE = 0x0004; // Use SE_BACKUP_NAME process special privileges - } - - internal static class RegistryView - { - internal const int KEY_WOW64_64KEY = 0x0100; - internal const int KEY_WOW64_32KEY = 0x0200; - } - - internal static class RegistryOperations - { - internal const int KEY_QUERY_VALUE = 0x0001; - internal const int KEY_SET_VALUE = 0x0002; - internal const int KEY_CREATE_SUB_KEY = 0x0004; - internal const int KEY_ENUMERATE_SUB_KEYS = 0x0008; - internal const int KEY_NOTIFY = 0x0010; - internal const int KEY_CREATE_LINK = 0x0020; - internal const int KEY_READ = ((STANDARD_RIGHTS_READ | - KEY_QUERY_VALUE | - KEY_ENUMERATE_SUB_KEYS | - KEY_NOTIFY) - & - (~SYNCHRONIZE)); - - internal const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE | - KEY_SET_VALUE | - KEY_CREATE_SUB_KEY) - & - (~SYNCHRONIZE)); - - internal const int SYNCHRONIZE = 0x00100000; - internal const int READ_CONTROL = 0x00020000; - internal const int STANDARD_RIGHTS_READ = READ_CONTROL; - internal const int STANDARD_RIGHTS_WRITE = READ_CONTROL; - } - - internal static class RegistryValues - { - internal const int REG_NONE = 0; // No value type - internal const int REG_SZ = 1; // Unicode nul terminated string - internal const int REG_EXPAND_SZ = 2; // Unicode nul terminated string - // (with environment variable references) - internal const int REG_BINARY = 3; // Free form binary - internal const int REG_DWORD = 4; // 32-bit number - internal const int REG_DWORD_LITTLE_ENDIAN = 4; // 32-bit number (same as REG_DWORD) - internal const int REG_DWORD_BIG_ENDIAN = 5; // 32-bit number - internal const int REG_LINK = 6; // Symbolic Link (Unicode) - internal const int REG_MULTI_SZ = 7; // Multiple Unicode strings - internal const int REG_QWORD = 11; // 64-bit number - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.cs deleted file mode 100644 index 42824c7eb73..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.GetRandomBytes.cs +++ /dev/null @@ -1,28 +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.Diagnostics; - -internal static partial class Interop -{ - internal static unsafe void GetRandomBytes(byte* buffer, int length) - { - Debug.Assert(buffer != null); - Debug.Assert(length >= 0); - - BCrypt.NTSTATUS status = BCrypt.BCryptGenRandom(IntPtr.Zero, buffer, length, BCrypt.BCRYPT_USE_SYSTEM_PREFERRED_RNG); - if (status != BCrypt.NTSTATUS.STATUS_SUCCESS) - { - if (status == BCrypt.NTSTATUS.STATUS_NO_MEMORY) - { - throw new OutOfMemoryException(); - } - else - { - throw new InvalidOperationException(); - } - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs deleted file mode 100644 index 1e6452f8fa9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ /dev/null @@ -1,17 +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; - -internal static partial class Interop -{ - internal static partial class BCrypt - { - internal const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002; - - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern unsafe NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.NTSTATUS.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.NTSTATUS.cs deleted file mode 100644 index af646aea985..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/BCrypt/Interop.NTSTATUS.cs +++ /dev/null @@ -1,18 +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. - -internal static partial class Interop -{ - internal static partial class BCrypt - { - internal enum NTSTATUS : uint - { - STATUS_SUCCESS = 0x0, - STATUS_NOT_FOUND = 0xc0000225, - STATUS_INVALID_PARAMETER = 0xc000000d, - STATUS_NO_MEMORY = 0xc0000017, - STATUS_AUTH_TAG_MISMATCH = 0xc000a002, - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs deleted file mode 100644 index cce01906ff6..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs +++ /dev/null @@ -1,21 +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.Runtime.InteropServices; -using System.Security; - -internal static partial class Interop -{ - internal static partial class Crypt32 - { - internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16; - internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0; - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags); - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOL.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOL.cs deleted file mode 100644 index b79d90fbe9f..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOL.cs +++ /dev/null @@ -1,21 +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. - -internal static partial class Interop -{ - /// <summary> - /// Blittable version of Windows BOOL type. It is convenient in situations where - /// manual marshalling is required, or to avoid overhead of regular bool marshalling. - /// </summary> - /// <remarks> - /// Some Windows APIs return arbitrary integer values although the return type is defined - /// as BOOL. It is best to never compare BOOL to TRUE. Always use bResult != BOOL.FALSE - /// or bResult == BOOL.FALSE . - /// </remarks> - internal enum BOOL : int - { - FALSE = 0, - TRUE = 1, - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOLEAN.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOLEAN.cs deleted file mode 100644 index 8158ffabde5..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.BOOLEAN.cs +++ /dev/null @@ -1,21 +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. - -internal static partial class Interop -{ - /// <summary> - /// Blittable version of Windows BOOLEAN type. It is convenient in situations where - /// manual marshalling is required, or to avoid overhead of regular bool marshalling. - /// </summary> - /// <remarks> - /// Some Windows APIs return arbitrary integer values although the return type is defined - /// as BOOLEAN. It is best to never compare BOOLEAN to TRUE. Always use bResult != BOOLEAN.FALSE - /// or bResult == BOOLEAN.FALSE . - /// </remarks> - internal enum BOOLEAN : byte - { - FALSE = 0, - TRUE = 1, - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Errors.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Errors.cs deleted file mode 100644 index cb6125de765..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Errors.cs +++ /dev/null @@ -1,46 +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. - -internal static partial class Interop -{ - // As defined in winerror.h and https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382.aspx - internal static partial class Errors - { - internal const int ERROR_SUCCESS = 0x0; - internal const int ERROR_FILE_NOT_FOUND = 0x2; - internal const int ERROR_PATH_NOT_FOUND = 0x3; - internal const int ERROR_ACCESS_DENIED = 0x5; - internal const int ERROR_INVALID_HANDLE = 0x6; - internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8; - internal const int ERROR_INVALID_DRIVE = 0xF; - internal const int ERROR_NO_MORE_FILES = 0x12; - internal const int ERROR_NOT_READY = 0x15; - internal const int ERROR_SHARING_VIOLATION = 0x20; - internal const int ERROR_HANDLE_EOF = 0x26; - internal const int ERROR_NOT_SUPPORTED = 0x32; - internal const int ERROR_FILE_EXISTS = 0x50; - internal const int ERROR_INVALID_PARAMETER = 0x57; - internal const int ERROR_BROKEN_PIPE = 0x6D; - internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A; - internal const int ERROR_INVALID_NAME = 0x7B; - internal const int ERROR_BAD_PATHNAME = 0xA1; - internal const int ERROR_ALREADY_EXISTS = 0xB7; - internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB; - internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE; - internal const int ERROR_NO_DATA = 0xE8; - internal const int ERROR_MORE_DATA = 0xEA; - internal const int ERROR_NO_MORE_ITEMS = 0x103; - internal const int ERROR_NOT_OWNER = 0x120; - internal const int ERROR_TOO_MANY_POSTS = 0x12A; - internal const int ERROR_ARITHMETIC_OVERFLOW = 0x216; - internal const int ERROR_MUTANT_LIMIT_EXCEEDED = 0x24B; - internal const int ERROR_OPERATION_ABORTED = 0x3E3; - internal const int ERROR_IO_PENDING = 0x3E5; - internal const int ERROR_NO_UNICODE_TRANSLATION = 0x459; - internal const int ERROR_NOT_FOUND = 0x490; - internal const int ERROR_BAD_IMPERSONATION_LEVEL = 0x542; - internal const int ERROR_NO_SYSTEM_RESOURCES = 0x5AA; - internal const int ERROR_TIMEOUT = 0x000005B4; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs deleted file mode 100644 index 8cbc8bfb266..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Interop.Libraries.cs +++ /dev/null @@ -1,20 +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. - -internal static partial class Interop -{ - internal static partial class Libraries - { - internal const string Advapi32 = "advapi32.dll"; - internal const string BCrypt = "BCrypt.dll"; - internal const string Crypt32 = "crypt32.dll"; - internal const string Kernel32 = "kernel32.dll"; - internal const string Ole32 = "ole32.dll"; - internal const string OleAut32 = "oleaut32.dll"; - internal const string User32 = "user32.dll"; - internal const string NtDll = "ntdll.dll"; - internal const string Secur32 = "secur32.dll"; - internal const string Shell32 = "shell32.dll"; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CancelIoEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CancelIoEx.cs deleted file mode 100644 index 057ebb924f4..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CancelIoEx.cs +++ /dev/null @@ -1,19 +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; -using System.Threading; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe bool CancelIoEx(IntPtr handle, NativeOverlapped* lpOverlapped); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CloseHandle.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CloseHandle.cs deleted file mode 100644 index c4385997185..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CloseHandle.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool CloseHandle(IntPtr handle); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CompletionPort.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CompletionPort.cs deleted file mode 100644 index 326f0e9df00..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CompletionPort.cs +++ /dev/null @@ -1,23 +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; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool PostQueuedCompletionStatus(IntPtr CompletionPort, int dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GetQueuedCompletionStatus(IntPtr CompletionPort, out int lpNumberOfBytes, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Constants.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Constants.cs deleted file mode 100644 index b13cdfd03fe..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Constants.cs +++ /dev/null @@ -1,15 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const int MAXIMUM_ALLOWED = 0x02000000; - internal const int SYNCHRONIZE = 0x00100000; - internal const int MUTEX_MODIFY_STATE = 0x00000001; - internal const int SEMAPHORE_MODIFY_STATE = 0x00000002; - internal const int EVENT_MODIFY_STATE = 0x00000002; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CreateFile.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CreateFile.cs deleted file mode 100644 index 9ebac4f6640..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.CreateFile.cs +++ /dev/null @@ -1,40 +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 Microsoft.Win32.SafeHandles; -using System; -using System.IO; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use CreateFile. - /// </summary> - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - private static extern SafeFileHandle CreateFilePrivate( - string lpFileName, - int dwDesiredAccess, - System.IO.FileShare dwShareMode, - ref SECURITY_ATTRIBUTES securityAttrs, - System.IO.FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile); - - internal static SafeFileHandle CreateFile( - string lpFileName, - int dwDesiredAccess, - System.IO.FileShare dwShareMode, - ref SECURITY_ATTRIBUTES securityAttrs, - System.IO.FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile) - { - lpFileName = PathInternal.EnsureExtendedPrefixIfNeeded(lpFileName); - return CreateFilePrivate(lpFileName, dwDesiredAccess, dwShareMode, ref securityAttrs, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs deleted file mode 100644 index c3adfadb53d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs +++ /dev/null @@ -1,29 +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. - -#nullable enable -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const uint CREATE_EVENT_INITIAL_SET = 0x2; - internal const uint CREATE_EVENT_MANUAL_RESET = 0x1; - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetEvent(SafeWaitHandle handle); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ResetEvent(SafeWaitHandle handle); - - [DllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess); - - [DllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle OpenEvent(uint desiredAccess, bool inheritHandle, string name); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs deleted file mode 100644 index fbd5da84b8e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_INFO_BY_HANDLE_CLASS.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_INFO_BY_HANDLE_CLASS.cs deleted file mode 100644 index 5ea23ea96ad..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_INFO_BY_HANDLE_CLASS.cs +++ /dev/null @@ -1,35 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal enum FILE_INFO_BY_HANDLE_CLASS : uint - { - FileBasicInfo = 0x0u, - FileStandardInfo = 0x1u, - FileNameInfo = 0x2u, - FileRenameInfo = 0x3u, - FileDispositionInfo = 0x4u, - FileAllocationInfo = 0x5u, - FileEndOfFileInfo = 0x6u, - FileStreamInfo = 0x7u, - FileCompressionInfo = 0x8u, - FileAttributeTagInfo = 0x9u, - FileIdBothDirectoryInfo = 0xAu, - FileIdBothDirectoryRestartInfo = 0xBu, - FileIoPriorityHintInfo = 0xCu, - FileRemoteProtocolInfo = 0xDu, - FileFullDirectoryInfo = 0xEu, - FileFullDirectoryRestartInfo = 0xFu, - FileStorageInfo = 0x10u, - FileAlignmentInfo = 0x11u, - FileIdInfo = 0x12u, - FileIdExtdDirectoryInfo = 0x13u, - FileIdExtdDirectoryRestartInfo = 0x14u, - MaximumFileInfoByHandleClass = 0x15u, - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_TIME.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_TIME.cs deleted file mode 100644 index 6a6464c4c8e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FILE_TIME.cs +++ /dev/null @@ -1,27 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal struct FILE_TIME - { - internal uint dwLowDateTime; - internal uint dwHighDateTime; - - internal FILE_TIME(long fileTime) - { - dwLowDateTime = (uint)fileTime; - dwHighDateTime = (uint)(fileTime >> 32); - } - - internal long ToTicks() => ((long)dwHighDateTime << 32) + dwLowDateTime; - internal DateTime ToDateTimeUtc() => DateTime.FromFileTimeUtc(ToTicks()); - internal DateTimeOffset ToDateTimeOffset() => DateTimeOffset.FromFileTime(ToTicks()); - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileAttributes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileAttributes.cs deleted file mode 100644 index 2cf4e287d3c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileAttributes.cs +++ /dev/null @@ -1,17 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal partial class FileAttributes - { - internal const int FILE_ATTRIBUTE_NORMAL = 0x00000080; - internal const int FILE_ATTRIBUTE_READONLY = 0x00000001; - internal const int FILE_ATTRIBUTE_DIRECTORY = 0x00000010; - internal const int FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs deleted file mode 100644 index 676e344a51d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL FileTimeToSystemTime(long* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs deleted file mode 100644 index a23ba1a3a0b..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FileTypes.cs +++ /dev/null @@ -1,17 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal partial class FileTypes - { - internal const int FILE_TYPE_UNKNOWN = 0x0000; - internal const int FILE_TYPE_DISK = 0x0001; - internal const int FILE_TYPE_CHAR = 0x0002; - internal const int FILE_TYPE_PIPE = 0x0003; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs deleted file mode 100644 index 4bd534933d6..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool FindClose(IntPtr hFindFile); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs deleted file mode 100644 index 6ab52b4d0e9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs +++ /dev/null @@ -1,44 +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. - -#nullable enable -using Microsoft.Win32.SafeHandles; -using System; -using System.IO; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use FindFirstFile. - /// </summary> - [DllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags); - - internal static SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data) - { - fileName = PathInternal.EnsureExtendedPrefixIfNeeded(fileName); - - // use FindExInfoBasic since we don't care about short name and it has better perf - return FindFirstFileExPrivate(fileName, FINDEX_INFO_LEVELS.FindExInfoBasic, ref data, FINDEX_SEARCH_OPS.FindExSearchNameMatch, IntPtr.Zero, 0); - } - - internal enum FINDEX_INFO_LEVELS : uint - { - FindExInfoStandard = 0x0u, - FindExInfoBasic = 0x1u, - FindExInfoMaxInfoLevel = 0x2u, - } - - internal enum FINDEX_SEARCH_OPS : uint - { - FindExSearchNameMatch = 0x0u, - FindExSearchLimitToDirectories = 0x1u, - FindExSearchLimitToDevices = 0x2u, - FindExSearchMaxSearchOp = 0x3u, - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs deleted file mode 100644 index 2b145d3d7dd..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs +++ /dev/null @@ -1,15 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool FlushFileBuffers(SafeHandle hHandle); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FormatMessage.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FormatMessage.cs deleted file mode 100644 index 2eda58f2504..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FormatMessage.cs +++ /dev/null @@ -1,88 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; - private const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; - private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; - private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; - private const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; - private const int ERROR_INSUFFICIENT_BUFFER = 0x7A; - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "FormatMessageW", SetLastError = true, BestFitMapping = true)] - private static extern unsafe int FormatMessage( - int dwFlags, - IntPtr lpSource, - uint dwMessageId, - int dwLanguageId, - void* lpBuffer, - int nSize, - IntPtr arguments); - - /// <summary> - /// Returns a string message for the specified Win32 error code. - /// </summary> - internal static string GetMessage(int errorCode) => - GetMessage(errorCode, IntPtr.Zero); - - internal static unsafe string GetMessage(int errorCode, IntPtr moduleHandle) - { - int flags = FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY; - if (moduleHandle != IntPtr.Zero) - { - flags |= FORMAT_MESSAGE_FROM_HMODULE; - } - - // First try to format the message into the stack based buffer. Most error messages willl fit. - Span<char> stackBuffer = stackalloc char[256]; // arbitrary stack limit - fixed (char* bufferPtr = stackBuffer) - { - int length = FormatMessage(flags, moduleHandle, unchecked((uint)errorCode), 0, bufferPtr, stackBuffer.Length, IntPtr.Zero); - if (length > 0) - { - return GetAndTrimString(stackBuffer.Slice(0, length)); - } - } - - // We got back an error. If the error indicated that there wasn't enough room to store - // the error message, then call FormatMessage again, but this time rather than passing in - // a buffer, have the method allocate one, which we then need to free. - if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) - { - IntPtr nativeMsgPtr = default; - try - { - int length = FormatMessage(flags | FORMAT_MESSAGE_ALLOCATE_BUFFER, moduleHandle, unchecked((uint)errorCode), 0, &nativeMsgPtr, 0, IntPtr.Zero); - if (length > 0) - { - return GetAndTrimString(new Span<char>((char*)nativeMsgPtr, length)); - } - } - finally - { - Marshal.FreeHGlobal(nativeMsgPtr); - } - } - - // Couldn't get a message, so manufacture one. - return string.Format("Unknown error (0x{0:x})", errorCode); - } - - private static string GetAndTrimString(Span<char> buffer) - { - int length = buffer.Length; - while (length > 0 && buffer[length - 1] <= 32) - { - length--; // trim off spaces and non-printable ASCII chars at the end of the resource - } - return buffer.Slice(0, length).ToString(); - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs deleted file mode 100644 index c222db8ef91..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "FreeEnvironmentStringsW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern unsafe bool FreeEnvironmentStrings(char* lpszEnvironmentBlock); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeLibrary.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeLibrary.cs deleted file mode 100644 index 56d52fefbb0..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.FreeLibrary.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern bool FreeLibrary(IntPtr hModule); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GET_FILEEX_INFO_LEVELS.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GET_FILEEX_INFO_LEVELS.cs deleted file mode 100644 index 4ee86420322..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GET_FILEEX_INFO_LEVELS.cs +++ /dev/null @@ -1,15 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal enum GET_FILEEX_INFO_LEVELS : uint - { - GetFileExInfoStandard = 0x0u, - GetFileExMaxInfoLevel = 0x1u, - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs deleted file mode 100644 index b22a149b123..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCPInfo.cs +++ /dev/null @@ -1,23 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct CPINFO - { - internal int MaxCharSize; - - internal fixed byte DefaultChar[2 /* MAX_DEFAULTCHAR */]; - internal fixed byte LeadByte[12 /* MAX_LEADBYTES */]; - } - - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetComputerName.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetComputerName.cs deleted file mode 100644 index 011430da5c7..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetComputerName.cs +++ /dev/null @@ -1,29 +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. - -#nullable enable -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetComputerNameW")] - private static extern unsafe int GetComputerName(ref char lpBuffer, ref uint nSize); - - // maximum length of the NETBIOS name (not including NULL) - private const int MAX_COMPUTERNAME_LENGTH = 15; - - internal static unsafe string? GetComputerName() - { - Span<char> buffer = stackalloc char[MAX_COMPUTERNAME_LENGTH + 1]; - uint length = (uint)buffer.Length; - - return GetComputerName(ref MemoryMarshal.GetReference(buffer), ref length) != 0 ? - buffer.Slice(0, (int)length).ToString() : - null; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs deleted file mode 100644 index 4e30a8be432..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs deleted file mode 100644 index 5369a8049df..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs +++ /dev/null @@ -1,17 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - [SuppressGCTransition] - internal static extern uint GetCurrentProcessId(); - } - - internal static uint GetCurrentProcessId() => Kernel32.GetCurrentProcessId(); -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcess_IntPtr.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcess_IntPtr.cs deleted file mode 100644 index a763735651a..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentProcess_IntPtr.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr GetCurrentProcess(); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs deleted file mode 100644 index 775ddabfb6a..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs +++ /dev/null @@ -1,16 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - [SuppressGCTransition] - public static extern int GetCurrentThreadId(); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs deleted file mode 100644 index 5594fe7a4cb..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentStringsW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern unsafe char* GetEnvironmentStrings(); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs deleted file mode 100644 index 43463e52304..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs +++ /dev/null @@ -1,23 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal static unsafe int GetEnvironmentVariable(string lpName, Span<char> buffer) - { - fixed (char* bufferPtr = &MemoryMarshal.GetReference(buffer)) - { - return GetEnvironmentVariable(lpName, bufferPtr, buffer.Length); - } - } - - [DllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern unsafe int GetEnvironmentVariable(string lpName, char* lpBuffer, int nSize); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs deleted file mode 100644 index 8d2e754edba..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs +++ /dev/null @@ -1,25 +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. - -#nullable enable -using System.IO; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx. - /// </summary> - [DllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", SetLastError = true, CharSet = CharSet.Unicode)] - private static extern bool GetFileAttributesExPrivate(string name, GET_FILEEX_INFO_LEVELS fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation); - - internal static bool GetFileAttributesEx(string name, GET_FILEEX_INFO_LEVELS fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation) - { - name = PathInternal.EnsureExtendedPrefixIfNeeded(name); - return GetFileAttributesExPrivate(name, fileInfoLevel, ref lpFileInformation); - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs deleted file mode 100644 index 92bee35cf42..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs +++ /dev/null @@ -1,24 +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 Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetFileInformationByHandleEx(SafeFileHandle hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, out FILE_STANDARD_INFO lpFileInformation, uint dwBufferSize); - - internal struct FILE_STANDARD_INFO - { - internal long AllocationSize; - internal long EndOfFile; - internal uint NumberOfLinks; - internal BOOL DeletePending; - internal BOOL Directory; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs deleted file mode 100644 index cdde2f0e4d9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern int GetFileType(SafeHandle hFile); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs deleted file mode 100644 index 1bb63e7ed1d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs +++ /dev/null @@ -1,18 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. - /// </summary> - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetFullPathNameW(ref char lpFileName, uint nBufferLength, ref char lpBuffer, IntPtr lpFilePart); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs deleted file mode 100644 index 2400eb3aac4..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern int GetLogicalDrives(); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs deleted file mode 100644 index 189c8e8cfe3..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs +++ /dev/null @@ -1,17 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper. - /// </summary> - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetLongPathNameW(ref char lpszShortPath, ref char lpszLongPath, uint cchBuffer); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs deleted file mode 100644 index 1d004bb8e91..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs +++ /dev/null @@ -1,30 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct PROCESS_MEMORY_COUNTERS - { - public uint cb; - public uint PageFaultCount; - public UIntPtr PeakWorkingSetSize; - public UIntPtr WorkingSetSize; - public UIntPtr QuotaPeakPagedPoolUsage; - public UIntPtr QuotaPagedPoolUsage; - public UIntPtr QuotaPeakNonPagedPoolUsage; - public UIntPtr QuotaNonPagedPoolUsage; - public UIntPtr PagefileUsage; - public UIntPtr PeakPagefileUsage; - } - - [DllImport(Libraries.Kernel32, EntryPoint="K32GetProcessMemoryInfo")] - internal static extern bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs deleted file mode 100644 index 451394539c6..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetStdHandle.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetStdHandle.cs deleted file mode 100644 index c73c86e935e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetStdHandle.cs +++ /dev/null @@ -1,16 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - [SuppressGCTransition] - internal static extern IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one! - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs deleted file mode 100644 index 197f6f5eadc..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern uint GetSystemDirectoryW(ref char lpBuffer, uint uSize); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs deleted file mode 100644 index 9e5b21c6b7f..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern void GetSystemInfo(out SYSTEM_INFO lpSystemInfo); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTime.cs deleted file mode 100644 index ed0aa147454..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimeAsFileTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimeAsFileTime.cs deleted file mode 100644 index fc8b030a4c1..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimeAsFileTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe void GetSystemTimeAsFileTime(long* lpSystemTimeAsFileTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimePreciseAsFileTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimePreciseAsFileTime.cs deleted file mode 100644 index 0067d90a808..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimePreciseAsFileTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe void GetSystemTimePreciseAsFileTime(long* lpSystemTimeAsFileTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs deleted file mode 100644 index 34f8ad7b6df..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetSystemTimes(out long idle, out long kernel, out long user); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs deleted file mode 100644 index d7f9b828c0c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] - internal static extern uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempPathW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempPathW.cs deleted file mode 100644 index 8d2b0b199ed..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetTempPathW.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern uint GetTempPathW(int bufferLen, ref char buffer); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetVersionExW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetVersionExW.cs deleted file mode 100644 index 5899bdb5259..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GetVersionExW.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool GetVersionExW(ref OSVERSIONINFOEX osvi); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs deleted file mode 100644 index e25c8ef4f59..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs +++ /dev/null @@ -1,20 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal static unsafe bool GlobalMemoryStatusEx(ref MEMORYSTATUSEX buffer) - { - buffer.length = sizeof(MEMORYSTATUSEX); - return GlobalMemoryStatusExNative(ref buffer); - } - - [DllImport(Libraries.Kernel32, SetLastError = true, EntryPoint = "GlobalMemoryStatusEx")] - private static extern bool GlobalMemoryStatusExNative(ref MEMORYSTATUSEX lpBuffer); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs deleted file mode 100644 index 192e555bba8..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs +++ /dev/null @@ -1,145 +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; - -internal static partial class Interop -{ - internal static unsafe partial class Kernel32 - { - internal const uint LOCALE_ALLOW_NEUTRAL_NAMES = 0x08000000; // Flag to allow returning neutral names/lcids for name conversion - internal const uint LOCALE_ILANGUAGE = 0x00000001; - internal const uint LOCALE_SUPPLEMENTAL = 0x00000002; - internal const uint LOCALE_REPLACEMENT = 0x00000008; - internal const uint LOCALE_NEUTRALDATA = 0x00000010; - internal const uint LOCALE_SPECIFICDATA = 0x00000020; - internal const uint LOCALE_SISO3166CTRYNAME = 0x0000005A; - internal const uint LOCALE_SNAME = 0x0000005C; - internal const uint LOCALE_INEUTRAL = 0x00000071; - internal const uint LOCALE_SSHORTTIME = 0x00000079; - internal const uint LOCALE_STIMEFORMAT = 0x00001003; - internal const uint LOCALE_IFIRSTDAYOFWEEK = 0x0000100C; - internal const uint LOCALE_RETURN_NUMBER = 0x20000000; - internal const uint LOCALE_NOUSEROVERRIDE = 0x80000000; - - internal const uint LCMAP_SORTHANDLE = 0x20000000; - internal const uint LCMAP_HASH = 0x00040000; - - internal const int COMPARE_STRING = 0x0001; - - internal const uint TIME_NOSECONDS = 0x00000002; - - internal const string LOCALE_NAME_USER_DEFAULT = null; - internal const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale"; - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int LocaleNameToLCID(string lpName, uint dwFlags); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int LCMapStringEx( - string? lpLocaleName, - uint dwMapFlags, - char* lpSrcStr, - int cchSrc, - void* lpDestStr, - int cchDest, - void* lpVersionInformation, - void* lpReserved, - IntPtr sortHandle); - - [DllImport("kernel32.dll", EntryPoint = "FindNLSStringEx")] - internal static extern int FindNLSStringEx( - char* lpLocaleName, - uint dwFindNLSStringFlags, - char* lpStringSource, - int cchSource, - char* lpStringValue, - int cchValue, - int* pcchFound, - void* lpVersionInformation, - void* lpReserved, - IntPtr sortHandle); - - [DllImport("kernel32.dll", EntryPoint = "CompareStringEx")] - internal static extern int CompareStringEx( - char* lpLocaleName, - uint dwCmpFlags, - char* lpString1, - int cchCount1, - char* lpString2, - int cchCount2, - void* lpVersionInformation, - void* lpReserved, - IntPtr lParam); - - [DllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] - internal static extern int CompareStringOrdinal( - char* lpString1, - int cchCount1, - char* lpString2, - int cchCount2, - bool bIgnoreCase); - - [DllImport("kernel32.dll", EntryPoint = "FindStringOrdinal")] - internal static extern int FindStringOrdinal( - uint dwFindStringOrdinalFlags, - char* lpStringSource, - int cchSource, - char* lpStringValue, - int cchValue, - int bIgnoreCase); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern bool IsNLSDefinedString( - int Function, - uint dwFlags, - IntPtr lpVersionInformation, - char* lpString, - int cchStr); - - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - internal static extern Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); - - internal delegate BOOL EnumLocalesProcEx(char* lpLocaleString, uint dwFlags, void* lParam); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); - - internal delegate BOOL EnumTimeFormatsProcEx(char* lpTimeFormatString, void* lParam); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam); - - internal delegate BOOL EnumCalendarInfoProcExEx(char* lpCalendarInfoString, uint Calendar, IntPtr lpReserved, void* lParam); - - [StructLayout(LayoutKind.Sequential)] - internal struct NlsVersionInfoEx - { - internal int dwNLSVersionInfoSize; - internal int dwNLSVersion; - internal int dwDefinedVersion; - internal int dwEffectiveId; - internal Guid guidCustomVersion; - } - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.HandleTypes.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.HandleTypes.cs deleted file mode 100644 index a5a42af560e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.HandleTypes.cs +++ /dev/null @@ -1,16 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal partial class HandleTypes - { - internal const int STD_INPUT_HANDLE = -10; - internal const int STD_OUTPUT_HANDLE = -11; - internal const int STD_ERROR_HANDLE = -12; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs deleted file mode 100644 index 43936ab3fae..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.IsWow64Process_IntPtr.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool IsWow64Process(IntPtr hProcess, out bool Wow64Process); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs deleted file mode 100644 index 7693f628075..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs +++ /dev/null @@ -1,19 +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 Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002; - internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800; - - [DllImport(Libraries.Kernel32, EntryPoint = "LoadLibraryExW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeLibraryHandle LoadLibraryEx(string libFilename, IntPtr reserved, int flags); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LocalAlloc.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LocalAlloc.cs deleted file mode 100644 index 14486c2b533..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LocalAlloc.cs +++ /dev/null @@ -1,24 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const uint LMEM_FIXED = 0x0000; - internal const uint LMEM_MOVEABLE = 0x0002; - - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr LocalAlloc(uint uFlags, UIntPtr uBytes); - - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr LocalReAlloc(IntPtr hMem, IntPtr uBytes, uint uFlags); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern IntPtr LocalFree(IntPtr hMem); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LockFile.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LockFile.cs deleted file mode 100644 index 82c7e4998b8..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.LockFile.cs +++ /dev/null @@ -1,18 +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 Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MAX_PATH.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MAX_PATH.cs deleted file mode 100644 index 9de12c94041..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MAX_PATH.cs +++ /dev/null @@ -1,11 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const int MAX_PATH = 260; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORYSTATUSEX.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORYSTATUSEX.cs deleted file mode 100644 index 83d1d860d1b..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORYSTATUSEX.cs +++ /dev/null @@ -1,26 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct MEMORYSTATUSEX - { - // The length field must be set to the size of this data structure. - internal int length; - internal int memoryLoad; - internal ulong totalPhys; - internal ulong availPhys; - internal ulong totalPageFile; - internal ulong availPageFile; - internal ulong totalVirtual; - internal ulong availVirtual; - internal ulong availExtendedVirtual; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFORMATION.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFORMATION.cs deleted file mode 100644 index ce49fb58179..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MEMORY_BASIC_INFORMATION.cs +++ /dev/null @@ -1,24 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct MEMORY_BASIC_INFORMATION - { - internal void* BaseAddress; - internal void* AllocationBase; - internal uint AllocationProtect; - internal UIntPtr RegionSize; - internal uint State; - internal uint Protect; - internal uint Type; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MUI.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MUI.cs deleted file mode 100644 index 12867a8527b..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MUI.cs +++ /dev/null @@ -1,16 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const uint MUI_PREFERRED_UI_LANGUAGES = 0x10; - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern unsafe bool GetFileMUIPath(uint dwFlags, string pcwszFilePath, char* pwszLanguage, ref int pcchLanguage, char* pwszFileMUIPath, ref int pcchFileMUIPath, ref long pululEnumerator); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs deleted file mode 100644 index d369cb49c7c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs +++ /dev/null @@ -1,19 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe int MultiByteToWideChar( - uint CodePage, uint dwFlags, - byte* lpMultiByteStr, int cbMultiByte, - char* lpWideCharStr, int cchWideChar); - - internal const uint MB_PRECOMPOSED = 0x00000001; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Mutex.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Mutex.cs deleted file mode 100644 index 6adaf987370..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Mutex.cs +++ /dev/null @@ -1,25 +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. - -#nullable enable -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1; - - [DllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle OpenMutex(uint desiredAccess, bool inheritHandle, string name); - - [DllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ReleaseMutex(SafeWaitHandle handle); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OSVERSIONINFOEX.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OSVERSIONINFOEX.cs deleted file mode 100644 index 0f6e2e6b333..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OSVERSIONINFOEX.cs +++ /dev/null @@ -1,27 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal unsafe struct OSVERSIONINFOEX - { - public int dwOSVersionInfoSize; - public int dwMajorVersion; - public int dwMinorVersion; - public int dwBuildNumber; - public int dwPlatformId; - public fixed char szCSDVersion[128]; - public ushort wServicePackMajor; - public ushort wServicePackMinor; - public ushort wSuiteMask; - public byte wProductType; - public byte wReserved; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OutputDebugString.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OutputDebugString.cs deleted file mode 100644 index 3ad3edde73d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.OutputDebugString.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "OutputDebugStringW", ExactSpelling = true)] - internal static extern void OutputDebugString(string message); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs deleted file mode 100644 index 63f68473234..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs +++ /dev/null @@ -1,23 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - // The actual native signature is: - // BOOL WINAPI QueryPerformanceCounter( - // _Out_ LARGE_INTEGER* lpPerformanceCount - // ); - // - // We take a long* (rather than a out long) to avoid the pinning overhead. - // We don't set last error since we don't need the extended error info. - - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - [SuppressGCTransition] - internal static extern unsafe BOOL QueryPerformanceCounter(long* lpPerformanceCount); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs deleted file mode 100644 index 641451b671f..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs +++ /dev/null @@ -1,22 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - // The actual native signature is: - // BOOL WINAPI QueryPerformanceFrequency( - // _Out_ LARGE_INTEGER* lpFrequency - // ); - // - // We take a long* (rather than a out long) to avoid the pinning overhead. - // We don't set last error since we don't need the extended error info. - - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe BOOL QueryPerformanceFrequency(long* lpFrequency); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs deleted file mode 100644 index f7264d4dc8c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs deleted file mode 100644 index b9f1c9584d8..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs +++ /dev/null @@ -1,20 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( - SafeHandle handle, - byte* bytes, - int numBytesToRead, - out int numBytesRead, - IntPtr mustBeZero); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs deleted file mode 100644 index a3c72547f96..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs +++ /dev/null @@ -1,21 +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; -using System.Threading; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( - SafeHandle handle, - byte* bytes, - int numBytesToRead, - IntPtr numBytesRead_mustBeZero, - NativeOverlapped* overlapped); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs deleted file mode 100644 index c349129d515..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs +++ /dev/null @@ -1,16 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static unsafe partial class Kernel32 - { - internal const int LOCALE_NAME_MAX_LENGTH = 85; - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SECURITY_ATTRIBUTES.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SECURITY_ATTRIBUTES.cs deleted file mode 100644 index f2f32fd2775..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SECURITY_ATTRIBUTES.cs +++ /dev/null @@ -1,20 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct SECURITY_ATTRIBUTES - { - internal uint nLength; - internal IntPtr lpSecurityDescriptor; - internal BOOL bInheritHandle; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SYSTEM_INFO.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SYSTEM_INFO.cs deleted file mode 100644 index 0ebeeff1933..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SYSTEM_INFO.cs +++ /dev/null @@ -1,38 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct SYSTEM_INFO - { - internal ushort wProcessorArchitecture; - internal ushort wReserved; - internal int dwPageSize; - internal IntPtr lpMinimumApplicationAddress; - internal IntPtr lpMaximumApplicationAddress; - internal IntPtr dwActiveProcessorMask; - internal int dwNumberOfProcessors; - internal int dwProcessorType; - internal int dwAllocationGranularity; - internal short wProcessorLevel; - internal short wProcessorRevision; - } - - internal enum ProcessorArchitecture : ushort - { - Processor_Architecture_INTEL = 0, - Processor_Architecture_ARM = 5, - Processor_Architecture_IA64 = 6, - Processor_Architecture_AMD64 = 9, - Processor_Architecture_ARM64 = 12, - Processor_Architecture_UNKNOWN = 0xFFFF - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SecurityOptions.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SecurityOptions.cs deleted file mode 100644 index bc9f5806771..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SecurityOptions.cs +++ /dev/null @@ -1,18 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal static partial class SecurityOptions - { - internal const int SECURITY_SQOS_PRESENT = 0x00100000; - internal const int SECURITY_ANONYMOUS = 0 << 16; - internal const int SECURITY_IDENTIFICATION = 1 << 16; - internal const int SECURITY_IMPERSONATION = 2 << 16; - internal const int SECURITY_DELEGATION = 3 << 16; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Semaphore.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Semaphore.cs deleted file mode 100644 index 4f6d8de8768..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.Semaphore.cs +++ /dev/null @@ -1,23 +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. - -#nullable enable -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle OpenSemaphore(uint desiredAccess, bool inheritHandle, string name); - - [DllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs deleted file mode 100644 index d268d4daa6f..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern bool SetCurrentDirectory(string path); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs deleted file mode 100644 index 6d93e151cf6..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs +++ /dev/null @@ -1,15 +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 Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetEndOfFile(SafeFileHandle hFile); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs deleted file mode 100644 index 243bd6562e0..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern bool SetEnvironmentVariable(string lpName, string? lpValue); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs deleted file mode 100644 index e83806697f1..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs +++ /dev/null @@ -1,15 +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 Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs deleted file mode 100644 index f582c20c58e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs +++ /dev/null @@ -1,17 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true, ExactSpelling = true)] - [SuppressGCTransition] - internal static extern bool SetThreadErrorMode(uint dwNewMode, out uint lpOldMode); - - internal const uint SEM_FAILCRITICALERRORS = 1; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs deleted file mode 100644 index c347eeae7f8..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, long* lpFileTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.Registry.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.Registry.cs deleted file mode 100644 index 14993bcca62..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.Registry.cs +++ /dev/null @@ -1,30 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct REG_TZI_FORMAT - { - internal int Bias; - internal int StandardBias; - internal int DaylightBias; - internal SYSTEMTIME StandardDate; - internal SYSTEMTIME DaylightDate; - - internal REG_TZI_FORMAT(in TIME_ZONE_INFORMATION tzi) - { - Bias = tzi.Bias; - StandardDate = tzi.StandardDate; - StandardBias = tzi.StandardBias; - DaylightDate = tzi.DaylightDate; - DaylightBias = tzi.DaylightBias; - } - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs deleted file mode 100644 index 7be40ca8f4c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs +++ /dev/null @@ -1,93 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal struct SYSTEMTIME - { - internal ushort Year; - internal ushort Month; - internal ushort DayOfWeek; - internal ushort Day; - internal ushort Hour; - internal ushort Minute; - internal ushort Second; - internal ushort Milliseconds; - - internal bool Equals(in SYSTEMTIME other) => - Year == other.Year && - Month == other.Month && - DayOfWeek == other.DayOfWeek && - Day == other.Day && - Hour == other.Hour && - Minute == other.Minute && - Second == other.Second && - Milliseconds == other.Milliseconds; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal unsafe struct TIME_DYNAMIC_ZONE_INFORMATION - { - internal int Bias; - internal fixed char StandardName[32]; - internal SYSTEMTIME StandardDate; - internal int StandardBias; - internal fixed char DaylightName[32]; - internal SYSTEMTIME DaylightDate; - internal int DaylightBias; - internal fixed char TimeZoneKeyName[128]; - internal byte DynamicDaylightTimeDisabled; - - internal string GetTimeZoneKeyName() - { - fixed (char* p = TimeZoneKeyName) - return new string(p); - } - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal unsafe struct TIME_ZONE_INFORMATION - { - internal int Bias; - internal fixed char StandardName[32]; - internal SYSTEMTIME StandardDate; - internal int StandardBias; - internal fixed char DaylightName[32]; - internal SYSTEMTIME DaylightDate; - internal int DaylightBias; - - internal TIME_ZONE_INFORMATION(in TIME_DYNAMIC_ZONE_INFORMATION dtzi) - { - // The start of TIME_DYNAMIC_ZONE_INFORMATION has identical layout as TIME_ZONE_INFORMATION - fixed (TIME_ZONE_INFORMATION* pTo = &this) - fixed (TIME_DYNAMIC_ZONE_INFORMATION* pFrom = &dtzi) - *pTo = *(TIME_ZONE_INFORMATION*)pFrom; - } - - internal string GetStandardName() - { - fixed (char* p = StandardName) - return new string(p); - } - - internal string GetDaylightName() - { - fixed (char* p = DaylightName) - return new string(p); - } - } - - internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1); - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs deleted file mode 100644 index 5cea7e071cf..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs +++ /dev/null @@ -1,18 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL TzSpecificLocalTimeToSystemTime( - IntPtr lpTimeZoneInformation, - Interop.Kernel32.SYSTEMTIME* lpLocalTime, - Interop.Kernel32.SYSTEMTIME* lpUniversalTime); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs deleted file mode 100644 index 96e6172bc63..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs +++ /dev/null @@ -1,14 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs deleted file mode 100644 index f8bd85a2a71..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs +++ /dev/null @@ -1,20 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const byte VER_GREATER_EQUAL = 0x3; - internal const uint VER_MAJORVERSION = 0x0000002; - internal const uint VER_MINORVERSION = 0x0000001; - internal const uint VER_SERVICEPACKMAJOR = 0x0000020; - internal const uint VER_SERVICEPACKMINOR = 0x0000010; - - [DllImport(Libraries.Kernel32)] - internal static extern bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs deleted file mode 100644 index 6fa12851417..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualAlloc.cs +++ /dev/null @@ -1,21 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal const int MEM_COMMIT = 0x1000; - internal const int MEM_RESERVE = 0x2000; - internal const int MEM_RELEASE = 0x8000; - internal const int MEM_FREE = 0x10000; - internal const int PAGE_READWRITE = 0x04; - - [DllImport(Libraries.Kernel32)] - internal static extern unsafe void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualFree.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualFree.cs deleted file mode 100644 index 75dbdf04777..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualFree.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualQuery.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualQuery.cs deleted file mode 100644 index 1c9655693d9..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.VirtualQuery.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FILE_ATTRIBUTE_DATA.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FILE_ATTRIBUTE_DATA.cs deleted file mode 100644 index 05607443da4..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FILE_ATTRIBUTE_DATA.cs +++ /dev/null @@ -1,29 +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. - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - internal struct WIN32_FILE_ATTRIBUTE_DATA - { - internal int dwFileAttributes; - internal FILE_TIME ftCreationTime; - internal FILE_TIME ftLastAccessTime; - internal FILE_TIME ftLastWriteTime; - internal uint nFileSizeHigh; - internal uint nFileSizeLow; - - internal void PopulateFrom(ref WIN32_FIND_DATA findData) - { - dwFileAttributes = (int)findData.dwFileAttributes; - ftCreationTime = findData.ftCreationTime; - ftLastAccessTime = findData.ftLastAccessTime; - ftLastWriteTime = findData.ftLastWriteTime; - nFileSizeHigh = findData.nFileSizeHigh; - nFileSizeLow = findData.nFileSizeLow; - } - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FIND_DATA.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FIND_DATA.cs deleted file mode 100644 index f1ed25f83b4..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WIN32_FIND_DATA.cs +++ /dev/null @@ -1,32 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal unsafe struct WIN32_FIND_DATA - { - internal uint dwFileAttributes; - internal FILE_TIME ftCreationTime; - internal FILE_TIME ftLastAccessTime; - internal FILE_TIME ftLastWriteTime; - internal uint nFileSizeHigh; - internal uint nFileSizeLow; - internal uint dwReserved0; - internal uint dwReserved1; - private fixed char _cFileName[MAX_PATH]; - private fixed char _cAlternateFileName[14]; - - internal ReadOnlySpan<char> cFileName - { - get { fixed (char* c = _cFileName) return new ReadOnlySpan<char>(c, MAX_PATH); } - } - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs deleted file mode 100644 index 1925a8c5785..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs +++ /dev/null @@ -1,22 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe int WideCharToMultiByte( - uint CodePage, uint dwFlags, - char* lpWideCharStr, int cchWideChar, - byte* lpMultiByteStr, int cbMultiByte, - IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar); - - internal const uint CP_ACP = 0; - internal const uint WC_NO_BEST_FIT_CHARS = 0x00000400; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs deleted file mode 100644 index e25d205259d..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs +++ /dev/null @@ -1,22 +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; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - // Note there are two different WriteFile prototypes - this is to use - // the type system to force you to not trip across a "feature" in - // Win32's async IO support. You can't do the following three things - // simultaneously: overlapped IO, free the memory for the overlapped - // struct in a callback (or an EndWrite method called by that callback), - // and pass in an address for the numBytesRead parameter. - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs deleted file mode 100644 index 9c01f0a5fb7..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs +++ /dev/null @@ -1,22 +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; -using System.Threading; - -internal static partial class Interop -{ - internal static partial class Kernel32 - { - // Note there are two different WriteFile prototypes - this is to use - // the type system to force you to not trip across a "feature" in - // Win32's async IO support. You can't do the following three things - // simultaneously: overlapped IO, free the memory for the overlapped - // struct in a callback (or an EndWrite method called by that callback), - // and pass in an address for the numBytesRead parameter. - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Idna.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Idna.cs deleted file mode 100644 index 039e34b5157..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Idna.cs +++ /dev/null @@ -1,34 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Normaliz - { - // - // Idn APIs - // - - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int IdnToAscii( - uint dwFlags, - char* lpUnicodeCharStr, - int cchUnicodeChar, - char* lpASCIICharStr, - int cchASCIIChar); - - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int IdnToUnicode( - uint dwFlags, - char* lpASCIICharStr, - int cchASCIIChar, - char* lpUnicodeCharStr, - int cchUnicodeChar); - - internal const int IDN_ALLOW_UNASSIGNED = 0x1; - internal const int IDN_USE_STD3_ASCII_RULES = 0x2; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Normalization.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Normalization.cs deleted file mode 100644 index 3e954483d18..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Normaliz/Interop.Normalization.cs +++ /dev/null @@ -1,23 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Normaliz - { - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool IsNormalizedString(int normForm, string source, int length); - - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int NormalizeString( - int normForm, - string source, - int sourceLength, - [System.Runtime.InteropServices.OutAttribute] - char[]? destination, - int destinationLength); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs deleted file mode 100644 index ed36e7898b3..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs +++ /dev/null @@ -1,46 +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 Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class NtDll - { - [DllImport(Libraries.NtDll, ExactSpelling = true)] - internal static extern unsafe int NtQueryInformationFile( - SafeFileHandle FileHandle, - out IO_STATUS_BLOCK IoStatusBlock, - void* FileInformation, - uint Length, - uint FileInformationClass); - - [StructLayout(LayoutKind.Sequential)] - internal struct IO_STATUS_BLOCK - { - private IO_STATUS Status; - private IntPtr Information; - } - - // This isn't an actual Windows type, we have to separate it out as the size of IntPtr varies by architecture - // and we can't specify the size at compile time to offset the Information pointer in the status block. - [StructLayout(LayoutKind.Explicit)] - internal struct IO_STATUS - { - [FieldOffset(0)] - private int Status; - - [FieldOffset(0)] - private IntPtr Pointer; - } - - internal const uint FileModeInformation = 16; - internal const uint FILE_SYNCHRONOUS_IO_ALERT = 0x00000010; - internal const uint FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020; - - internal const int STATUS_INVALID_HANDLE = unchecked((int)0xC0000008); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs deleted file mode 100644 index dc8be886d6c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs +++ /dev/null @@ -1,23 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class NtDll - { - [DllImport(Libraries.NtDll)] - internal static extern unsafe int NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, int SystemInformationLength, uint* ReturnLength); - - [StructLayout(LayoutKind.Sequential)] - internal struct SYSTEM_LEAP_SECOND_INFORMATION - { - public bool Enabled; - public uint Flags; - } - - internal const int SystemLeapSecondInformation = 206; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs deleted file mode 100644 index 57accbe7c00..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class Ole32 - { - [DllImport(Interop.Libraries.Ole32)] - internal static extern int CoCreateGuid(out Guid guid); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs deleted file mode 100644 index e51dc99550c..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs +++ /dev/null @@ -1,21 +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; - -internal static partial class Interop -{ - internal static partial class Ole32 - { - [DllImport(Libraries.Ole32)] - internal static extern IntPtr CoTaskMemAlloc(UIntPtr cb); - - [DllImport(Libraries.Ole32)] - internal static extern IntPtr CoTaskMemRealloc(IntPtr pv, UIntPtr cb); - - [DllImport(Libraries.Ole32)] - internal static extern void CoTaskMemFree(IntPtr ptr); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs deleted file mode 100644 index 7c97ecdca7a..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class OleAut32 - { - [DllImport(Libraries.OleAut32)] - internal static extern IntPtr SysAllocStringByteLen(byte[]? str, uint len); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs deleted file mode 100644 index ac9459907bf..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs +++ /dev/null @@ -1,16 +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; -using System.Security; - -internal static partial class Interop -{ - internal static partial class OleAut32 - { - [DllImport(Libraries.OleAut32, CharSet = CharSet.Unicode)] - internal static extern IntPtr SysAllocStringLen(string? src, int len); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysFreeString.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysFreeString.cs deleted file mode 100644 index fea22df406a..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/OleAut32/Interop.SysFreeString.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class OleAut32 - { - [DllImport(Libraries.OleAut32)] - internal static extern void SysFreeString(IntPtr bstr); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Secur32/Interop.GetUserNameExW.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Secur32/Interop.GetUserNameExW.cs deleted file mode 100644 index e88864cd9e7..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Secur32/Interop.GetUserNameExW.cs +++ /dev/null @@ -1,16 +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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Secur32 - { - [DllImport(Libraries.Secur32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize); - - internal const int NameSamCompatible = 2; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs deleted file mode 100644 index 3e72b01e1f6..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs +++ /dev/null @@ -1,320 +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; - -internal static partial class Interop -{ - internal static partial class Shell32 - { - internal const int COR_E_PLATFORMNOTSUPPORTED = unchecked((int)0x80131539); - - // https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx - [DllImport(Libraries.Shell32, CharSet = CharSet.Unicode, SetLastError = false, BestFitMapping = false, ExactSpelling = true)] - internal static extern int SHGetKnownFolderPath( - [MarshalAs(UnmanagedType.LPStruct)] Guid rfid, - uint dwFlags, - IntPtr hToken, - out string ppszPath); - - // https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx - internal static class KnownFolders - { - /// <summary> - /// (CSIDL_ADMINTOOLS) Per user Administrative Tools - /// "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Administrative Tools" - /// </summary> - internal const string AdminTools = "{724EF170-A42D-4FEF-9F26-B60E846FBA4F}"; - - /// <summary> - /// (CSIDL_CDBURN_AREA) Temporary Burn folder - /// "%LOCALAPPDATA%\Microsoft\Windows\Burn\Burn" - /// </summary> - internal const string CDBurning = "{9E52AB10-F80D-49DF-ACB8-4330F5687855}"; - - /// <summary> - /// (CSIDL_COMMON_ADMINTOOLS) Common Administrative Tools - /// "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Administrative Tools" - /// </summary> - internal const string CommonAdminTools = "{D0384E7D-BAC3-4797-8F14-CBA229B392B5}"; - - /// <summary> - /// (CSIDL_COMMON_OEM_LINKS) OEM Links folder - /// "%ALLUSERSPROFILE%\OEM Links" - /// </summary> - internal const string CommonOEMLinks = "{C1BAE2D0-10DF-4334-BEDD-7AA20B227A9D}"; - - /// <summary> - /// (CSIDL_COMMON_PROGRAMS) Common Programs folder - /// "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs" - /// </summary> - internal const string CommonPrograms = "{0139D44E-6AFE-49F2-8690-3DAFCAE6FFB8}"; - - /// <summary> - /// (CSIDL_COMMON_STARTMENU) Common Start Menu folder - /// "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu" - /// </summary> - internal const string CommonStartMenu = "{A4115719-D62E-491D-AA7C-E74B8BE3B067}"; - - /// <summary> - /// (CSIDL_COMMON_STARTUP, CSIDL_COMMON_ALTSTARTUP) Common Startup folder - /// "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\StartUp" - /// </summary> - internal const string CommonStartup = "{82A5EA35-D9CD-47C5-9629-E15D2F714E6E}"; - - /// <summary> - /// (CSIDL_COMMON_TEMPLATES) Common Templates folder - /// "%ALLUSERSPROFILE%\Microsoft\Windows\Templates" - /// </summary> - internal const string CommonTemplates = "{B94237E7-57AC-4347-9151-B08C6C32D1F7}"; - - /// <summary> - /// (CSIDL_DRIVES) Computer virtual folder - /// </summary> - internal const string ComputerFolder = "{0AC0837C-BBF8-452A-850D-79D08E667CA7}"; - - /// <summary> - /// (CSIDL_CONNECTIONS) Network Connections virtual folder - /// </summary> - internal const string ConnectionsFolder = "{6F0CD92B-2E97-45D1-88FF-B0D186B8DEDD}"; - - /// <summary> - /// (CSIDL_CONTROLS) Control Panel virtual folder - /// </summary> - internal const string ControlPanelFolder = "{82A74AEB-AEB4-465C-A014-D097EE346D63}"; - - /// <summary> - /// (CSIDL_COOKIES) Cookies folder - /// "%APPDATA%\Microsoft\Windows\Cookies" - /// </summary> - internal const string Cookies = "{2B0F765D-C0E9-4171-908E-08A611B84FF6}"; - - /// <summary> - /// (CSIDL_DESKTOP, CSIDL_DESKTOPDIRECTORY) Desktop folder - /// "%USERPROFILE%\Desktop" - /// </summary> - internal const string Desktop = "{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"; - - /// <summary> - /// (CSIDL_MYDOCUMENTS, CSIDL_PERSONAL) Documents (My Documents) folder - /// "%USERPROFILE%\Documents" - /// </summary> - internal const string Documents = "{FDD39AD0-238F-46AF-ADB4-6C85480369C7}"; - - /// <summary> - /// (CSIDL_FAVORITES, CSIDL_COMMON_FAVORITES) Favorites folder - /// "%USERPROFILE%\Favorites" - /// </summary> - internal const string Favorites = "{1777F761-68AD-4D8A-87BD-30B759FA33DD}"; - - /// <summary> - /// (CSIDL_FONTS) Fonts folder - /// "%windir%\Fonts" - /// </summary> - internal const string Fonts = "{FD228CB7-AE11-4AE3-864C-16F3910AB8FE}"; - - /// <summary> - /// (CSIDL_HISTORY) History folder - /// "%LOCALAPPDATA%\Microsoft\Windows\History" - /// </summary> - internal const string History = "{D9DC8A3B-B784-432E-A781-5A1130A75963}"; - - /// <summary> - /// (CSIDL_INTERNET_CACHE) Temporary Internet Files folder - /// "%LOCALAPPDATA%\Microsoft\Windows\Temporary Internet Files" - /// </summary> - internal const string InternetCache = "{352481E8-33BE-4251-BA85-6007CAEDCF9D}"; - - /// <summary> - /// (CSIDL_INTERNET) The Internet virtual folder - /// </summary> - internal const string InternetFolder = "{4D9F7874-4E0C-4904-967B-40B0D20C3E4B}"; - - /// <summary> - /// (CSIDL_LOCAL_APPDATA) Local folder - /// "%LOCALAPPDATA%" ("%USERPROFILE%\AppData\Local") - /// </summary> - internal const string LocalAppData = "{F1B32785-6FBA-4FCF-9D55-7B8E7F157091}"; - - /// <summary> - /// (CSIDL_RESOURCES_LOCALIZED) Fixed localized resources folder - /// "%windir%\resources\0409" (per active codepage) - /// </summary> - internal const string LocalizedResourcesDir = "{2A00375E-224C-49DE-B8D1-440DF7EF3DDC}"; - - /// <summary> - /// (CSIDL_MYMUSIC) Music folder - /// "%USERPROFILE%\Music" - /// </summary> - internal const string Music = "{4BD8D571-6D19-48D3-BE97-422220080E43}"; - - /// <summary> - /// (CSIDL_NETHOOD) Network shortcuts folder "%APPDATA%\Microsoft\Windows\Network Shortcuts" - /// </summary> - internal const string NetHood = "{C5ABBF53-E17F-4121-8900-86626FC2C973}"; - - /// <summary> - /// (CSIDL_NETWORK, CSIDL_COMPUTERSNEARME) Network virtual folder - /// </summary> - internal const string NetworkFolder = "{D20BEEC4-5CA8-4905-AE3B-BF251EA09B53}"; - - /// <summary> - /// (CSIDL_MYPICTURES) Pictures folder "%USERPROFILE%\Pictures" - /// </summary> - internal const string Pictures = "{33E28130-4E1E-4676-835A-98395C3BC3BB}"; - - /// <summary> - /// (CSIDL_PRINTERS) Printers virtual folder - /// </summary> - internal const string PrintersFolder = "{76FC4E2D-D6AD-4519-A663-37BD56068185}"; - - /// <summary> - /// (CSIDL_PRINTHOOD) Printer Shortcuts folder - /// "%APPDATA%\Microsoft\Windows\Printer Shortcuts" - /// </summary> - internal const string PrintHood = "{9274BD8D-CFD1-41C3-B35E-B13F55A758F4}"; - - /// <summary> - /// (CSIDL_PROFILE) The root users profile folder "%USERPROFILE%" - /// ("%SystemDrive%\Users\%USERNAME%") - /// </summary> - internal const string Profile = "{5E6C858F-0E22-4760-9AFE-EA3317B67173}"; - - /// <summary> - /// (CSIDL_COMMON_APPDATA) ProgramData folder - /// "%ALLUSERSPROFILE%" ("%ProgramData%", "%SystemDrive%\ProgramData") - /// </summary> - internal const string ProgramData = "{62AB5D82-FDC1-4DC3-A9DD-070D1D495D97}"; - - /// <summary> - /// (CSIDL_PROGRAM_FILES) Program Files folder for the current process architecture - /// "%ProgramFiles%" ("%SystemDrive%\Program Files") - /// </summary> - internal const string ProgramFiles = "{905e63b6-c1bf-494e-b29c-65b732d3d21a}"; - - /// <summary> - /// (CSIDL_PROGRAM_FILESX86) 32 bit Program Files folder (available to both 32/64 bit processes) - /// </summary> - internal const string ProgramFilesX86 = "{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}"; - - /// <summary> - /// (CSIDL_PROGRAM_FILES_COMMON) Common Program Files folder for the current process architecture - /// "%ProgramFiles%\Common Files" - /// </summary> - internal const string ProgramFilesCommon = "{F7F1ED05-9F6D-47A2-AAAE-29D317C6F066}"; - - /// <summary> - /// (CSIDL_PROGRAM_FILES_COMMONX86) Common 32 bit Program Files folder (available to both 32/64 bit processes) - /// </summary> - internal const string ProgramFilesCommonX86 = "{DE974D24-D9C6-4D3E-BF91-F4455120B917}"; - - /// <summary> - /// (CSIDL_PROGRAMS) Start menu Programs folder - /// "%APPDATA%\Microsoft\Windows\Start Menu\Programs" - /// </summary> - internal const string Programs = "{A77F5D77-2E2B-44C3-A6A2-ABA601054A51}"; - - /// <summary> - /// (CSIDL_COMMON_DESKTOPDIRECTORY) Public Desktop folder - /// "%PUBLIC%\Desktop" - /// </summary> - internal const string PublicDesktop = "{C4AA340D-F20F-4863-AFEF-F87EF2E6BA25}"; - - /// <summary> - /// (CSIDL_COMMON_DOCUMENTS) Public Documents folder - /// "%PUBLIC%\Documents" - /// </summary> - internal const string PublicDocuments = "{ED4824AF-DCE4-45A8-81E2-FC7965083634}"; - - /// <summary> - /// (CSIDL_COMMON_MUSIC) Public Music folder - /// "%PUBLIC%\Music" - /// </summary> - internal const string PublicMusic = "{3214FAB5-9757-4298-BB61-92A9DEAA44FF}"; - - /// <summary> - /// (CSIDL_COMMON_PICTURES) Public Pictures folder - /// "%PUBLIC%\Pictures" - /// </summary> - internal const string PublicPictures = "{B6EBFB86-6907-413C-9AF7-4FC2ABF07CC5}"; - - /// <summary> - /// (CSIDL_COMMON_VIDEO) Public Videos folder - /// "%PUBLIC%\Videos" - /// </summary> - internal const string PublicVideos = "{2400183A-6185-49FB-A2D8-4A392A602BA3}"; - - /// <summary> - /// (CSIDL_RECENT) Recent Items folder - /// "%APPDATA%\Microsoft\Windows\Recent" - /// </summary> - internal const string Recent = "{AE50C081-EBD2-438A-8655-8A092E34987A}"; - - /// <summary> - /// (CSIDL_BITBUCKET) Recycle Bin virtual folder - /// </summary> - internal const string RecycleBinFolder = "{B7534046-3ECB-4C18-BE4E-64CD4CB7D6AC}"; - - /// <summary> - /// (CSIDL_RESOURCES) Resources fixed folder - /// "%windir%\Resources" - /// </summary> - internal const string ResourceDir = "{8AD10C31-2ADB-4296-A8F7-E4701232C972}"; - - /// <summary> - /// (CSIDL_APPDATA) Roaming user application data folder - /// "%APPDATA%" ("%USERPROFILE%\AppData\Roaming") - /// </summary> - internal const string RoamingAppData = "{3EB685DB-65F9-4CF6-A03A-E3EF65729F3D}"; - - /// <summary> - /// (CSIDL_SENDTO) SendTo folder - /// "%APPDATA%\Microsoft\Windows\SendTo" - /// </summary> - internal const string SendTo = "{8983036C-27C0-404B-8F08-102D10DCFD74}"; - - /// <summary> - /// (CSIDL_STARTMENU) Start Menu folder - /// "%APPDATA%\Microsoft\Windows\Start Menu" - /// </summary> - internal const string StartMenu = "{625B53C3-AB48-4EC1-BA1F-A1EF4146FC19}"; - - /// <summary> - /// (CSIDL_STARTUP, CSIDL_ALTSTARTUP) Startup folder - /// "%APPDATA%\Microsoft\Windows\Start Menu\Programs\StartUp" - /// </summary> - internal const string Startup = "{B97D20BB-F46A-4C97-BA10-5E3608430854}"; - - /// <summary> - /// (CSIDL_SYSTEM) System32 folder - /// "%windir%\system32" - /// </summary> - internal const string System = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}"; - - /// <summary> - /// (CSIDL_SYSTEMX86) X86 System32 folder - /// "%windir%\system32" or "%windir%\syswow64" - /// </summary> - internal const string SystemX86 = "{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}"; - - /// <summary> - /// (CSIDL_TEMPLATES) Templates folder - /// "%APPDATA%\Microsoft\Windows\Templates" - /// </summary> - internal const string Templates = "{A63293E8-664E-48DB-A079-DF759E0509F7}"; - - /// <summary> - /// (CSIDL_MYVIDEO) Videos folder - /// "%USERPROFILE%\Videos" - /// </summary> - internal const string Videos = "{18989B1D-99B5-455B-841C-AB7C74E4DDFC}"; - - /// <summary> - /// (CSIDL_WINDOWS) Windows folder "%windir%" - /// </summary> - internal const string Windows = "{F38BF404-1D43-42F2-9305-67DE0B28FC23}"; - } - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.Constants.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.Constants.cs deleted file mode 100644 index a48329fb6b1..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.Constants.cs +++ /dev/null @@ -1,12 +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. - -internal static partial class Interop -{ - internal static partial class User32 - { - internal const int HWND_BROADCAST = 0xffff; - internal const int WM_SETTINGCHANGE = 0x001A; - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.LoadString.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.LoadString.cs deleted file mode 100644 index e328e9b0c1e..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.LoadString.cs +++ /dev/null @@ -1,15 +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.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class User32 - { - [DllImport(Libraries.User32, SetLastError = true, EntryPoint = "LoadStringW", CharSet = CharSet.Unicode)] - internal static extern unsafe int LoadString(SafeLibraryHandle hInstance, uint uID, char* lpBuffer, int cchBufferMax); - } -} diff --git a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.SendMessageTimeout.cs b/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.SendMessageTimeout.cs deleted file mode 100644 index f73c0aceaa8..00000000000 --- a/netcore/System.Private.CoreLib/shared/Interop/Windows/User32/Interop.SendMessageTimeout.cs +++ /dev/null @@ -1,15 +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; - -internal static partial class Interop -{ - internal static partial class User32 - { - [DllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW", CharSet = CharSet.Unicode)] - public static extern IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, string lParam, int flags, int timeout, IntPtr pdwResult); - } -} |