SafeHandle.IsClosed SafeHandle.IsClosed SafeHandle.IsClosed SafeHandle.IsClosed Property


Gets a value indicating whether the handle is closed.

 property bool IsClosed { bool get(); };
public bool IsClosed { get; }
member this.IsClosed : bool
Public ReadOnly Property IsClosed As Boolean

Property Value

true if the handle is closed; otherwise, false.


The IsClosed method returns a value indicating whether the SafeHandle object's handle is no longer associated with a native resource. This differs from the definition of the IsInvalid property, which computes whether a given handle is always considered invalid. The IsClosed method returns a true value in the following cases:


for permission to call unmanaged code. Security action: LinkDemand. Associated enumeration: UnmanagedCode

Applies to