SafeRegistryHandle(IntPtr, Boolean) Constructor

Definition

Initializes a new instance of the SafeRegistryHandle class.

public:
 SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle);
[System.Security.SecurityCritical]
public SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle);
[<System.Security.SecurityCritical>]
new Microsoft.Win32.SafeHandles.SafeRegistryHandle : nativeint * bool -> Microsoft.Win32.SafeHandles.SafeRegistryHandle
Public Sub New (preexistingHandle As IntPtr, ownsHandle As Boolean)

Parameters

preexistingHandle
IntPtr

nativeint

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