<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0-preview.6.20305.6" />

SafeRegistryHandle

public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid
Represents a safe handle to the Windows registry.
using System; namespace Microsoft.Win32.SafeHandles { public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid { public override bool IsInvalid { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } } public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } protected override bool ReleaseHandle() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_Registry); } } }