Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 39c4ddf

Browse files
Anipikdanmoseley
authored andcommitted
Using shared copy of registryvalueKind (#31922)
* using local copy of registryvaluekind and advapi32 * Moving complete file to shared * name changed
1 parent d9365f5 commit 39c4ddf

File tree

6 files changed

+18
-63
lines changed

6 files changed

+18
-63
lines changed

src/Common/src/Interop/Windows/advapi32/Interop.RegistryOptions.cs renamed to src/Common/src/CoreLib/Interop/Windows/Advapi32/Interop.RegistryConstants.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ internal partial class Interop
66
{
77
internal partial class Advapi32
88
{
9-
internal partial class RegistryOptions
9+
internal static class RegistryOptions
1010
{
1111
internal const int REG_OPTION_NON_VOLATILE = 0x0000; // (default) keys are persisted beyond reboot/unload
1212
internal const int REG_OPTION_VOLATILE = 0x0001; // All keys created by the function are volatile
1313
internal const int REG_OPTION_CREATE_LINK = 0x0002; // They key is a symbolic link
14-
internal const int REG_OPTION_BACKUP_RESTORE = 0x0004; // Use SE_BACKUP_NAME process special privileges
14+
internal const int REG_OPTION_BACKUP_RESTORE = 0x0004; // Use SE_BACKUP_NAME process special privileges
1515
}
1616

17-
internal partial class RegistryView
17+
internal static class RegistryView
1818
{
1919
internal const int KEY_WOW64_64KEY = 0x0100;
2020
internal const int KEY_WOW64_32KEY = 0x0200;
2121
}
2222

23-
internal partial class RegistryOperations
23+
internal static class RegistryOperations
2424
{
2525
internal const int KEY_QUERY_VALUE = 0x0001;
2626
internal const int KEY_SET_VALUE = 0x0002;
@@ -47,7 +47,7 @@ internal partial class RegistryOperations
4747
internal const int STANDARD_RIGHTS_WRITE = READ_CONTROL;
4848
}
4949

50-
internal partial class RegistryValues
50+
internal static class RegistryValues
5151
{
5252
internal const int REG_NONE = 0; // No value type
5353
internal const int REG_SZ = 1; // Unicode nul terminated string
@@ -62,4 +62,4 @@ internal partial class RegistryValues
6262
internal const int REG_QWORD = 11; // 64-bit number
6363
}
6464
}
65-
}
65+
}

src/Common/src/CoreLib/Interop/Windows/Kernel32/Interop.RegistryValues.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Common/src/CoreLib/Microsoft/Win32/RegistryValueKind.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ namespace Microsoft.Win32
1111
#endif
1212
enum RegistryValueKind
1313
{
14-
String = Interop.Kernel32.RegistryValues.REG_SZ,
15-
ExpandString = Interop.Kernel32.RegistryValues.REG_EXPAND_SZ,
16-
Binary = Interop.Kernel32.RegistryValues.REG_BINARY,
17-
DWord = Interop.Kernel32.RegistryValues.REG_DWORD,
18-
MultiString = Interop.Kernel32.RegistryValues.REG_MULTI_SZ,
19-
QWord = Interop.Kernel32.RegistryValues.REG_QWORD,
14+
String = Interop.Advapi32.RegistryValues.REG_SZ,
15+
ExpandString = Interop.Advapi32.RegistryValues.REG_EXPAND_SZ,
16+
Binary = Interop.Advapi32.RegistryValues.REG_BINARY,
17+
DWord = Interop.Advapi32.RegistryValues.REG_DWORD,
18+
MultiString = Interop.Advapi32.RegistryValues.REG_MULTI_SZ,
19+
QWord = Interop.Advapi32.RegistryValues.REG_QWORD,
2020
Unknown = 0, // REG_NONE is defined as zero but BCL
2121
None = unchecked((int)0xFFFFFFFF), // mistakenly overrode this value.
2222
} // Now instead of using Interop.Kernel32.RegistryValues.REG_NONE we use "-1".

src/Common/src/CoreLib/System.Private.CoreLib.Shared.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,6 @@
761761
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.OutputDebugString.cs" />
762762
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_IntPtr.cs" />
763763
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.ReadFile_SafeHandle_NativeOverlapped.cs" />
764-
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.RegistryValues.cs" />
765764
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.RegistryView.cs" />
766765
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs" />
767766
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Kernel32\Interop.SecurityOptions.cs" />
@@ -806,6 +805,7 @@
806805
</ItemGroup>
807806
<ItemGroup Condition="$(TargetsWindows) and '$(EnableWinRT)' != 'true'">
808807
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\NtDll\NtQueryInformationFile.cs" />
808+
<Compile Include="$(MSBuildThisFileDirectory)Interop\Windows\Advapi32\Interop.RegistryConstants.cs" />
809809
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileStream.Win32.cs" />
810810
<Compile Include="$(MSBuildThisFileDirectory)System\TimeZoneInfo.Win32.cs" />
811811
<Compile Include="$(MSBuildThisFileDirectory)Microsoft\Win32\Registry.cs" />

src/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@
1515
<Configurations>net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Unix-Debug;netcoreapp-Unix-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard-Unix-Debug;netstandard-Unix-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
1616
</PropertyGroup>
1717
<ItemGroup Condition="'$(TargetsNetFx)' != 'true' AND '$(OSGroup)' != 'AnyOS'">
18-
<Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.RegistryOptions.cs">
19-
<Link>Common\Interop\Windows\Interop.RegistryOptions.cs</Link>
18+
<Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Advapi32\Interop.RegistryConstants.cs">
19+
<Link>Common\CoreLib\Interop\Windows\Advapi32\Interop.RegistryConstants.cs</Link>
2020
</Compile>
2121
<Compile Include="$(CommonPath)\CoreLib\Microsoft\Win32\Registry.cs">
2222
<Link>Common\CoreLib\Microsoft\Win32\Registry.cs</Link>
2323
</Compile>
2424
<Compile Include="$(CommonPath)\CoreLib\Microsoft\Win32\RegistryHive.cs">
2525
<Link>Common\CoreLib\Microsoft\Win32\RegistryHive.cs</Link>
2626
</Compile>
27+
<Compile Include="$(CommonPath)\CoreLib\Microsoft\Win32\RegistryValueKind.cs">
28+
<Link>Common\CoreLib\Microsoft\Win32\RegistryValueKind.cs"</Link>
29+
</Compile>
2730
<Compile Include="$(CommonPath)\CoreLib\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs">
2831
<Link>Common\CoreLib\Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs</Link>
2932
</Compile>
3033
<Compile Include="Microsoft\Win32\RegistryKey.cs" />
3134
<Compile Include="Microsoft\Win32\RegistryKeyPermissionCheck.cs" />
3235
<Compile Include="Microsoft\Win32\RegistryOptions.cs" />
33-
<Compile Include="Microsoft\Win32\RegistryValueKind.cs" />
3436
<Compile Include="Microsoft\Win32\RegistryValueOptions.cs" />
3537
<Compile Include="Microsoft\Win32\RegistryView.cs" />
3638
<Compile Include="Microsoft\Win32\ThrowHelper.cs" />

src/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryValueKind.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)