Kernel32OpenMutex Method

Opens an existing named mutex object.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr OpenMutex(
	uint desiredAccess,
	bool inheritHandle,
	string name
)

Parameters

desiredAccess  UInt32
The access To the mutex Object.

Only the Synchronize access right Is required To use a mutex; To change the mutex's security, specify MUTEX_ALL_ACCESS.

The function fails if the security descriptor of the specified object does not permit the requested access for the calling process.

inheritHandle  Boolean
If this value Is , processes created by this process will inherit the handle. Otherwise, the processes Do Not inherit this handle.
name  String
The name of the mutex to be opened. Name comparisons are case sensitive.

This function can open objects in a private namespace.

Return Value

IntPtr
If the function succeeds, the return value is a handle to the mutex object.

If the function fails, the return value is Zero.

Remarks

See Also