The OpenMutex function returns a handle of an existing named mutex object.
HANDLE OpenMutex(
DWORD dwDesiredAccess, |
// access flag |
BOOL bInheritHandle, |
// inherit flag |
LPCTSTR lpName |
// pointer to mutex-object name |
); |
This parameter can be any combination of the following values:
Access |
Description |
MUTEX_ALL_ACCESS |
Specifies all possible access flags for the mutex object. |
SYNCHRONIZE |
Windows NT only: Enables use of the mutex handle in any of the wait functions to acquire ownership of the mutex, or in the ReleaseMutex function to release ownership. |
If the function succeeds, the return value is a handle of the mutex object.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
The OpenMutex function enables multiple processes to open handles of the same mutex object. The function succeeds only if some process has already created the mutex by using the CreateMutex function. The calling process can use the returned handle in any function that requires a handle of a mutex object, such as the wait functions, subject to the limitations of the access specified in the dwDesiredAccess parameter.
The handle can be duplicated by using the DuplicateHandle function. Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.
CloseHandle, CreateMutex, CreateProcess, DuplicateHandle, ReleaseMutex
file: /Techref/os/win/api/win32/func/src/f66_4.htm, 4KB, , updated: 2000/4/7 11:19, local time: 2024/11/28 06:23,
3.133.124.23:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/TECHREF/os/win/api/win32/func/src/f66_4.htm"> OpenMutex</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.