Group: Synchronization - Library: kernel32
Using shared memory to exchange data between applications (processes)
HANDLE CreateMutex(
LPSECURITY_ATTRIBUTES lpMutexAttributes,
BOOL bInitialOwner,
LPCTSTR lpName
); DECLARE INTEGER CreateMutex IN kernel32;
INTEGER lpMutexAttributes,;
INTEGER bInitialOwner,;
STRING lpName lpMutexAttributes [in] Pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpMutexAttributes is NULL, the handle cannot be inherited.
bInitialOwner [in] If this value is TRUE and the caller created the mutex, the calling thread obtains initial ownership of the mutex object.
lpName [in] Pointer to a null-terminated string specifying the name of the mutex object. If lpName is NULL, the mutex object is created without a name.
If the function succeeds, the return value is a handle to the newly created mutex object.
If the mutex is a named mutex and the object existed before this function call, the return value is a handle to the existing object and GetLastError returns ERROR_ALREADY_EXISTS.
See also: ReleaseMutex, CloseHandle, CreateSemaphore, WaitForSingleObject.
Home