diff options
author | Anirudh Agnihotry <anirudhagnihotry098@gmail.com> | 2018-08-26 21:03:12 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-08-27 16:03:23 -0700 |
commit | 9272df6f658e6d2badbccd8abdbd75201de64863 (patch) | |
tree | 463e90c2c585fa6f73c1dc6020e8f7b24a04f9e1 /src | |
parent | 41f67dba85067e7c7c72b316a2cf29a4ec7d1e15 (diff) | |
download | coreclr-9272df6f658e6d2badbccd8abdbd75201de64863.tar.gz coreclr-9272df6f658e6d2badbccd8abdbd75201de64863.tar.bz2 coreclr-9272df6f658e6d2badbccd8abdbd75201de64863.zip |
Using shared copy of registryvalueKind (dotnet/corefx#31922)
* using local copy of registryvaluekind and advapi32
* Moving complete file to shared
* name changed
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Diffstat (limited to 'src')
4 files changed, 72 insertions, 31 deletions
diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs b/src/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs new file mode 100644 index 0000000000..bdb89702f8 --- /dev/null +++ b/src/System.Private.CoreLib/shared/Interop/Windows/Advapi32/Interop.RegistryConstants.cs @@ -0,0 +1,65 @@ +// 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 partial class Interop +{ + internal 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 + } + } +}
\ No newline at end of file diff --git a/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.RegistryValues.cs b/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.RegistryValues.cs deleted file mode 100644 index 3c02c4976b..0000000000 --- a/src/System.Private.CoreLib/shared/Interop/Windows/Kernel32/Interop.RegistryValues.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. - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal partial 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/src/System.Private.CoreLib/shared/Microsoft/Win32/RegistryValueKind.cs b/src/System.Private.CoreLib/shared/Microsoft/Win32/RegistryValueKind.cs index 5395abe067..bc6efcc06f 100644 --- a/src/System.Private.CoreLib/shared/Microsoft/Win32/RegistryValueKind.cs +++ b/src/System.Private.CoreLib/shared/Microsoft/Win32/RegistryValueKind.cs @@ -11,12 +11,12 @@ namespace Microsoft.Win32 #endif enum RegistryValueKind { - String = Interop.Kernel32.RegistryValues.REG_SZ, - ExpandString = Interop.Kernel32.RegistryValues.REG_EXPAND_SZ, - Binary = Interop.Kernel32.RegistryValues.REG_BINARY, - DWord = Interop.Kernel32.RegistryValues.REG_DWORD, - MultiString = Interop.Kernel32.RegistryValues.REG_MULTI_SZ, - QWord = Interop.Kernel32.RegistryValues.REG_QWORD, + String = Interop.Advapi32.RegistryValues.REG_SZ, + ExpandString = Interop.Advapi32.RegistryValues.REG_EXPAND_SZ, + Binary = Interop.Advapi32.RegistryValues.REG_BINARY, + DWord = Interop.Advapi32.RegistryValues.REG_DWORD, + MultiString = Interop.Advapi32.RegistryValues.REG_MULTI_SZ, + QWord = Interop.Advapi32.RegistryValues.REG_QWORD, Unknown = 0, // REG_NONE is defined as zero but BCL None = unchecked((int)0xFFFFFFFF), // mistakenly overrode this value. } // Now instead of using Interop.Kernel32.RegistryValues.REG_NONE we use "-1". diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems index ef48dc6c95..69765a4817 100644 --- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems +++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems @@ -761,7 +761,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.OutputDebugString.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.RegistryValues.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.RegistryView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SecurityOptions.cs" /> @@ -806,6 +805,7 @@ </ItemGroup> <ItemGroup Condition="$(TargetsWindows) and '$(EnableWinRT)' != 'true'"> <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\NtDll\NtQueryInformationFile.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Advapi32\Interop.RegistryConstants.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Win32.cs" /> <Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Win32.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\Registry.cs" /> |