SafeRegistryHandle Constructors

Definition

Overloads

SafeRegistryHandle()

Source:
SafeRegistryHandle.cs

Creates a SafeRegistryHandle.

public SafeRegistryHandle ();

Applies to

.NET 9 and other versions
Product Versions
.NET 6, 7, 8, 9

SafeRegistryHandle(IntPtr, Boolean)

Source:
SafeRegistryHandle.cs

Initializes a new instance of the SafeRegistryHandle class.

public SafeRegistryHandle (IntPtr preexistingHandle, bool ownsHandle);
[System.Security.SecurityCritical]
public SafeRegistryHandle (IntPtr preexistingHandle, bool ownsHandle);

Parameters

preexistingHandle
IntPtr

An object that represents the pre-existing handle to use.

ownsHandle
Boolean

true to reliably release the handle during the finalization phase; false to prevent reliable release.

Attributes

Remarks

Specifying false for ownsHandle is not recommended.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5