Represents a wrapper class for handle resources.
Assembly: mscorlib (in mscorlib.dll)
The class is similar to the SafeHandle class, except that SafeHandle implements reference counting. You can use instead of SafeHandle to address performance considerations when you can provide the necessary synchronization more efficiently yourself.
Because the class does not perform reference counting, it does not provide protection from handle recycling security attacks. Because the reference counting algorithm implicitly serializes operations, a certain amount of thread safety is also lost. If you call the IDisposable.Dispose or Close method while an operation that is using the handle is outstanding on another thread, or if you call IDisposable.Dispose or Close from two threads at the same time, the results are non-deterministic. The class still provides the guaranteed critical finalization provided by the CriticalFinalizerObject class.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.