Kernel32OpenMutex Method
Opens an existing named mutex object.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function OpenMutex (
desiredAccess As UInteger,
inheritHandle As Boolean,
name As String
) As IntPtr
Dim desiredAccess As UInteger
Dim inheritHandle As Boolean
Dim name As String
Dim returnValue As IntPtr
returnValue = Kernel32.OpenMutex(desiredAccess,
inheritHandle, name)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static IntPtr OpenMutex(
unsigned int desiredAccess,
bool inheritHandle,
String^ name
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member OpenMutex :
desiredAccess : uint32 *
inheritHandle : bool *
name : string -> IntPtr
No code example is currently available or this language may not be supported.
- 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.
IntPtr
If the function succeeds, the return value is a handle to the mutex object.
If the function fails, the return value is
Zero.