OpenMutex

From aldeid
Jump to navigation Jump to search

Description

Opens an existing named mutex object.

Parameters

HANDLE WINAPI OpenMutex(
  _In_  DWORD dwDesiredAccess,
  _In_  BOOL bInheritHandle,
  _In_  LPCTSTR lpName
);

Return value

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

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

If a named mutex does not exist, the function fails and GetLastError returns ERROR_FILE_NOT_FOUND.

Example

.text:00401046                 push    offset Name     ; "HGL345"
.text:0040104B                 push    0               ; bInheritHandle
.text:0040104D                 push    1F0001h         ; dwDesiredAccess
.text:00401052                 call    ds:OpenMutexA

Comments