Microsoft.Win32.SafeHandles Namespace

The Microsoft.Win32.SafeHandles namespace contains classes that are abstract derivations of safe handle classes that provide common functionality supporting file and operating system handles.

Remarks

These classes are derived from the System.Runtime.InteropServices.SafeHandle and System.Runtime.InteropServices.CriticalHandle classes.

Classes

TypeReason
CriticalHandleMinusOneIsInvalid

Provides a base class for Win32 critical handle implementations in which the value of -1 indicates an invalid handle.

CriticalHandleZeroOrMinusOneIsInvalid

Provides a base class for Win32 critical handle implementations in which the value of either 0 or -1 indicates an invalid handle.

SafeFileHandle

Represents a wrapper class for a file handle.

SafeHandleMinusOneIsInvalid

Provides a base class for Win32 safe handle implementations in which the value of -1 indicates an invalid handle.

SafeHandleZeroOrMinusOneIsInvalid

Provides a base class for Win32 safe handle implementations in which the value of either 0 or -1 indicates an invalid handle.

SafeMemoryMappedFileHandle

Provides a safe handle that represents a memory-mapped file for sequential access.

SafeMemoryMappedViewHandle

Provides a safe handle that represents a view of a block of unmanaged memory for random access.

SafePipeHandle

Represents a wrapper class for a pipe handle.

SafeRegistryHandle

Represents a safe handle to the Windows registry.

SafeWaitHandle

Represents a wrapper class for a wait handle.