IsClosed Property
Collapse the table of content
Expand the table of content

SafeHandle.IsClosed Property


Gets a value indicating whether the handle is closed.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public bool IsClosed { get; }

Property Value

Type: System.Boolean

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: SecurityPermissionFlag.UnmanagedCode

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft