SafeRegistryHandle(IntPtr, Boolean) SafeRegistryHandle(IntPtr, Boolean) SafeRegistryHandle(IntPtr, Boolean) 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);
new Microsoft.Win32.SafeHandles.SafeRegistryHandle : nativeint * bool -> Microsoft.Win32.SafeHandles.SafeRegistryHandle
Public Sub New (preexistingHandle As IntPtr, ownsHandle As Boolean)

Parameters

preexistingHandle
IntPtr IntPtr IntPtr IntPtr

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

ownsHandle
Boolean Boolean Boolean Boolean

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

Remarks

Specifying false for ownsHandle is not recommended.

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Applies to