SafeRegistryHandle public sealed class SafeRegistryHandle : SafeHandleZeroOrMinusOneIsInvalid Represents a safe handle to the Windows registry. Documentation Code public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) Initializes a new instance of the SafeRegistryHandle class.