Handle Property
Collapse the table of content
Expand the table of content

WaitHandle.Handle Property

 
obsoleteCodeEntityP:System.Threading.WaitHandle.SafeWaitHandleNote: This API is now obsolete.

Gets or sets the native operating system handle.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)

[ObsoleteAttribute("Use the SafeWaitHandle property instead.")]
public virtual IntPtr Handle {
	get;
	[SecurityCriticalAttribute]
	[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, 
		Flags = SecurityPermissionFlag.UnmanagedCode)]
	set;
}

Property Value

Type: System.IntPtr

An IntPtr representing the native operating system handle. The default is the value of the InvalidHandle field.

Assigning a new value to the Handle property does not close the previous handle. This can result in a leaked handle.

Do not use this property in the .NET Framework version 2.0 or later; use the SafeWaitHandle property instead. Setting this property to a valid handle also sets the SafeWaitHandle property, but setting it to InvalidHandle can result in a leaked handle.

SecurityCriticalAttribute

Requires full trust for the immediate caller to set the property value. This member cannot be set by partially trusted or transparent code.

InheritanceDemand

Derived types must have SecurityPermissionFlag.UnmanagedCode to set the property value.

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft