Mono Class Library: Microsoft.Win32.SafeHandles NamespaceMicrosoft.Win32.SafeHandles.SafeFileHandle Class |
See Also: SafeFileHandle Members
System.Object
System.Runtime.ConstrainedExecution.CriticalFinalizerObject
System.Runtime.InteropServices.SafeHandle
Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
Microsoft.Win32.SafeHandles.SafeFileHandle
|
This is a type safe System.Runtime.InteropServices.SafeHandle that wraps file descriptors.
Application developers should use SafeFileHandles instead of IntPtr for storing file handles, as SafeFileHandles will ensure that file descriptors are properly closed (even in the presence of an AppDomain unload) and will prevent problems like handle reuse.
SafeHandles can be used in P/Invoke parameters, P/Invoke return values and structures passed to unmanaged code.
[Edit]
Namespace: Microsoft.Win32.SafeHandles
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: