SafeWaitHandle Constructor (IntPtr, Boolean)

 

Initializes a new instance of the SafeWaitHandle class.

Namespace:   Microsoft.Win32.SafeHandles
Assembly:  mscorlib (in mscorlib.dll)

public:
SafeWaitHandle(
	IntPtr existingHandle,
	bool ownsHandle
)

Parameters

existingHandle
Type: System::IntPtr

An IntPtr object that represents the pre-existing handle to use.

ownsHandle
Type: System::Boolean

true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended).

The following code example demonstrates how to use interop to create a mutex using the SafeWaitHandle class and the unmanaged CreateMutex function.

No code example is currently available or this language may not be supported.

SecurityCriticalAttribute

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: