Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up Microsoft.Win32.Registry and remove the non-Windows code. #77996

Merged
merged 6 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ internal static partial class Interop
internal static partial class Advapi32
{
[LibraryImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int RegEnumKeyEx(
internal static unsafe partial int RegEnumKeyEx(
SafeRegistryHandle hKey,
int dwIndex,
[Out] char[] lpName,
ref char lpName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own education, why did you change this from a char array to a ref char?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the name is in a stackalloced span (could make it a char*, don't remember why I didn't).

ref int lpcbName,
int[]? lpReserved,
[Out] char[]? lpClass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,15 @@
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' != 'windows'">SR.PlatformNotSupported_Registry</GeneratePlatformNotSupportedAssemblyMessage>
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
Link="Common\DisableRuntimeMarshalling.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegistryConstants.cs"
Link="Common\Interop\Windows\Advapi32\Interop.RegistryConstants.cs" />
<Compile Include="$(CoreLibSharedDir)Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs"
Link="Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
<Compile Include="Microsoft\Win32\Registry.cs" />
<Compile Include="Microsoft\Win32\RegistryHive.cs" />
<Compile Include="Microsoft\Win32\RegistryValueKind.cs" />
<Compile Include="Microsoft\Win32\RegistryKey.cs" />
<Compile Include="Microsoft\Win32\RegistryKeyPermissionCheck.cs" />
<Compile Include="Microsoft\Win32\RegistryOptions.cs" />
<Compile Include="Microsoft\Win32\RegistryValueOptions.cs" />
<Compile Include="Microsoft\Win32\RegistryView.cs" />
<Compile Include="System\Security\AccessControl\RegistryRights.cs" />
<Compile Include="System\Security\AccessControl\RegistrySecurity.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Errors.cs"
Link="Common\Interop\Windows\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
Link="Common\Interop\Windows\Interop.FormatMessage.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegCloseKey.cs"
Link="Common\Interop\Windows\Interop.RegCloseKey.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegConnectRegistry.cs"
Expand All @@ -57,14 +43,24 @@
Link="Common\Interop\Windows\Interop.RegQueryValueEx.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegSetValueEx.cs"
Link="Common\Interop\Windows\Interop.RegSetValueEx.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Advapi32\Interop.RegistryConstants.cs"
Link="Common\Interop\Windows\Advapi32\Interop.RegistryConstants.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
Link="Common\Interop\Windows\Interop.BOOL.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.SECURITY_ATTRIBUTES.cs"
Link="Common\Interop\Windows\Interop.SECURITY_ATTRIBUTES.cs" />
<Compile Include="Microsoft\Win32\RegistryKey.Windows.cs" />
<Compile Include="$(CoreLibSharedDir)Microsoft\Win32\SafeHandles\SafeRegistryHandle.Windows.cs"
Link="Microsoft\Win32\SafeHandles\SafeRegistryHandle.Windows.cs" />
<Compile Include="System\Security\AccessControl\RegistrySecurity.Windows.cs" />
<Compile Include="$(CoreLibSharedDir)Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs"
Link="Microsoft\Win32\SafeHandles\SafeRegistryHandle.cs" />
<Compile Include="Microsoft\Win32\Registry.cs" />
<Compile Include="Microsoft\Win32\RegistryHive.cs" />
<Compile Include="Microsoft\Win32\RegistryValueKind.cs" />
<Compile Include="Microsoft\Win32\RegistryKey.cs" />
<Compile Include="Microsoft\Win32\RegistryKeyPermissionCheck.cs" />
<Compile Include="Microsoft\Win32\RegistryOptions.cs" />
<Compile Include="Microsoft\Win32\RegistryValueOptions.cs" />
<Compile Include="Microsoft\Win32\RegistryView.cs" />
<Compile Include="System\Security\AccessControl\RegistryRights.cs" />
<Compile Include="System\Security\AccessControl\RegistrySecurity.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Buffers" />
Expand Down
Loading