diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-12-22 11:46:17 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-12-23 17:43:21 +0300 |
commit | d1823e83d7335aa99b1cff887543a56c2b17aa78 (patch) | |
tree | 7f2df0ca5774734eb7270497845e0ef5d4d3d0ef /src/Common | |
parent | ca7ce91a101d1e5f796394046b8326af6dc9012e (diff) |
Refactor MEMORY_BASIC_INFORMATION, SYSTEM_INFO
Diffstat (limited to 'src/Common')
9 files changed, 55 insertions, 69 deletions
diff --git a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Libraries.cs b/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Libraries.cs index 0737bd1df..845776d54 100644 --- a/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Libraries.cs +++ b/src/Common/src/Interop/Unix/System.Private.CoreLib.Native/Interop.Libraries.cs @@ -5,7 +5,7 @@ using System; internal static partial class Interop { - internal static class Libraries + internal static partial class Libraries { internal const string SystemPrivateCoreLibNative = "System.Private.CoreLib.Native"; } diff --git a/src/Common/src/Interop/Windows/Interop.Libraries.cs b/src/Common/src/Interop/Windows/Interop.Libraries.cs index 641b8444f..049c4be28 100644 --- a/src/Common/src/Interop/Windows/Interop.Libraries.cs +++ b/src/Common/src/Interop/Windows/Interop.Libraries.cs @@ -3,26 +3,11 @@ internal static partial class Interop { - private static class Libraries + internal static partial class Libraries { - internal const string CoreString = "api-ms-win-core-string-l1-1-0.dll"; - internal const string Eventing = "api-ms-win-eventing-provider-l1-1-0.dll"; - internal const string Handle = "api-ms-win-core-handle-l1-1-0.dll"; - internal const string HeapObsolete = "api-ms-win-core-heap-obsolete-l1-1-0"; - internal const string Kernel32Legacy = "api-ms-win-core-kernel32-legacy-l1-1-0.dll"; - internal const string LibraryLoader = "api-ms-win-core-libraryloader-l1-1-0.dll"; - internal const string LSAPolicy = "api-ms-win-security-lsapolicy-l1-1-0"; - internal const string Localization = "api-ms-win-core-localization-l1-2-0.dll"; internal const string Memory = "api-ms-win-core-memory-l1-1-0.dll"; - internal const string NtDll = "ntdll.dll"; internal const string ProcessEnvironment = "api-ms-win-core-processenvironment-l1-1-0.dll"; - internal const string ProcessThreads = "api-ms-win-core-processthreads-l1-1-0.dll"; internal const string RealTime = "api-ms-win-core-realtime-l1-1-0.dll"; - internal const string Sddl = "api-ms-win-security-sddl-l1-1-0"; - internal const string Security = "api-ms-win-security-base-l1-1-0"; - internal const string Sspi = "sspicli.dll"; - internal const string Synch = "api-ms-win-core-synch-l1-1-0.dll"; internal const string SysInfo = "api-ms-win-core-sysinfo-l1-2-0.dll"; - internal const string ThreadPool = "api-ms-win-core-threadpool-l1-2-0.dll"; } } diff --git a/src/Common/src/Interop/Windows/Interop._MEMORY_BASIC_INFORMATION.cs b/src/Common/src/Interop/Windows/Interop._MEMORY_BASIC_INFORMATION.cs deleted file mode 100644 index 6ebae0ad9..000000000 --- a/src/Common/src/Interop/Windows/Interop._MEMORY_BASIC_INFORMATION.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - [StructLayout(LayoutKind.Sequential)] - internal struct _MEMORY_BASIC_INFORMATION - { - internal IntPtr BaseAddress; - internal IntPtr AllocationBase; - internal uint AllocationProtect; - internal UIntPtr RegionSize; - internal uint State; - internal uint Protect; - internal uint Type; - } -} diff --git a/src/Common/src/Interop/Windows/Interop._SYSTEM_INFO.cs b/src/Common/src/Interop/Windows/Interop._SYSTEM_INFO.cs deleted file mode 100644 index 84d73376b..000000000 --- a/src/Common/src/Interop/Windows/Interop._SYSTEM_INFO.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - [StructLayout(LayoutKind.Sequential)] - internal struct _SYSTEM_INFO - { - internal uint dwOemId; - internal uint dwPageSize; - internal IntPtr lpMinimumApplicationAddress; - internal IntPtr lpMaximumApplicationAddress; - internal UIntPtr dwActiveProcessorMask; - internal uint dwNumberOfProcessors; - internal uint dwProcessorType; - internal uint dwAllocationGranularity; - internal ushort wProcessorLevel; - internal ushort wProcessorRevision; - } -} diff --git a/src/Common/src/Interop/Windows/mincore/Interop.Environment.cs b/src/Common/src/Interop/Windows/mincore/Interop.Environment.cs index c1e6276e8..38750ae1a 100644 --- a/src/Common/src/Interop/Windows/mincore/Interop.Environment.cs +++ b/src/Common/src/Interop/Windows/mincore/Interop.Environment.cs @@ -7,18 +7,13 @@ using System.Runtime.InteropServices; internal static partial class Interop { - private static class Libraries - { - internal const string Process = "api-ms-win-core-processenvironment-l1-1-0.dll"; - } - internal static unsafe partial class mincore { // TODO: Once we have marshalling setup we probably want to revisit these PInvokes - [DllImport(Libraries.Process, EntryPoint = "GetEnvironmentVariableW")] + [DllImport(Libraries.ProcessEnvironment, EntryPoint = "GetEnvironmentVariableW")] internal static unsafe extern int GetEnvironmentVariable(char* lpName, char* lpValue, int size); - [DllImport(Libraries.Process, EntryPoint = "ExpandEnvironmentStringsW")] + [DllImport(Libraries.ProcessEnvironment, EntryPoint = "ExpandEnvironmentStringsW")] internal static unsafe extern int ExpandEnvironmentStrings(char* lpSrc, char* lpDst, int nSize); } } diff --git a/src/Common/src/Interop/Windows/mincore/Interop.GetNativeSystemInfo.cs b/src/Common/src/Interop/Windows/mincore/Interop.GetNativeSystemInfo.cs index 2b257efff..8515e09ac 100644 --- a/src/Common/src/Interop/Windows/mincore/Interop.GetNativeSystemInfo.cs +++ b/src/Common/src/Interop/Windows/mincore/Interop.GetNativeSystemInfo.cs @@ -9,6 +9,6 @@ internal static partial class Interop internal static partial class mincore { [DllImport(Interop.Libraries.SysInfo)] - internal extern static void GetNativeSystemInfo(out Interop._SYSTEM_INFO lpSystemInfo); + internal extern static void GetNativeSystemInfo(out SYSTEM_INFO lpSystemInfo); } } diff --git a/src/Common/src/Interop/Windows/mincore/Interop.MEMORY_BASIC_INFORMATION.cs b/src/Common/src/Interop/Windows/mincore/Interop.MEMORY_BASIC_INFORMATION.cs new file mode 100644 index 000000000..7cac68922 --- /dev/null +++ b/src/Common/src/Interop/Windows/mincore/Interop.MEMORY_BASIC_INFORMATION.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class mincore + { + [StructLayout(LayoutKind.Sequential)] + internal struct MEMORY_BASIC_INFORMATION + { + internal IntPtr BaseAddress; + internal IntPtr AllocationBase; + internal uint AllocationProtect; + internal UIntPtr RegionSize; + internal uint State; + internal uint Protect; + internal uint Type; + } + } +} diff --git a/src/Common/src/Interop/Windows/mincore/Interop.SYSTEM_INFO.cs b/src/Common/src/Interop/Windows/mincore/Interop.SYSTEM_INFO.cs new file mode 100644 index 000000000..aaf3bb033 --- /dev/null +++ b/src/Common/src/Interop/Windows/mincore/Interop.SYSTEM_INFO.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class mincore + { + [StructLayout(LayoutKind.Sequential)] + internal struct SYSTEM_INFO + { + internal uint dwOemId; + internal uint dwPageSize; + internal IntPtr lpMinimumApplicationAddress; + internal IntPtr lpMaximumApplicationAddress; + internal UIntPtr dwActiveProcessorMask; + internal uint dwNumberOfProcessors; + internal uint dwProcessorType; + internal uint dwAllocationGranularity; + internal ushort wProcessorLevel; + internal ushort wProcessorRevision; + } + } +} diff --git a/src/Common/src/Interop/Windows/mincore/Interop.VirtualQuery.cs b/src/Common/src/Interop/Windows/mincore/Interop.VirtualQuery.cs index 7b255bc02..455cad7dd 100644 --- a/src/Common/src/Interop/Windows/mincore/Interop.VirtualQuery.cs +++ b/src/Common/src/Interop/Windows/mincore/Interop.VirtualQuery.cs @@ -9,6 +9,6 @@ internal static partial class Interop internal static partial class mincore { [DllImport(Interop.Libraries.Memory)] - internal extern static UIntPtr VirtualQuery(IntPtr lpAddress, out Interop._MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); + internal extern static UIntPtr VirtualQuery(IntPtr lpAddress, out MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); } } |