Improve performance of RegistryKey.GetValue (#66918)
authorStephen Toub <stoub@microsoft.com>
Sat, 23 Jul 2022 11:01:04 +0000 (07:01 -0400)
committerGitHub <noreply@github.com>
Sat, 23 Jul 2022 11:01:04 +0000 (07:01 -0400)
commitcbfc5499e6024a0d53d7c9957c143cf45fac2987
tree6f772fe5e6d76d55a0943e6eafd6f60586d575b4
parent02ee8900cdb7fd6fc12b40aed338f787ff8e33df
Improve performance of RegistryKey.GetValue (#66918)

Reduces typical number of syscalls as well as avoids allocation (or uses the ArrayPool otherwise).

Also updates Corelib's copy of RegistryKey to match (with things like perf key support removed).
src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs
src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.Windows.cs
src/libraries/Microsoft.Win32.Registry/src/Resources/Strings.resx
src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_CorruptData.cs
src/libraries/Microsoft.Win32.Registry/tests/RegistryKey/RegistryKey_GetValue_str.cs
src/libraries/System.Private.CoreLib/src/Internal/Win32/RegistryKey.cs
src/libraries/System.Private.CoreLib/src/Resources/Strings.resx