Searches for an existing semaphore with the given name and returns its handle.
HANDLE RtOpenSemaphore( DWORD dwDesiredAccess, BOOLEAN bInheritHandle, LPCTSTR lpName );
dwDesiredAccess
bInheritHandle
lpName
RtOpenSemaphore can also be used from a Windows application to obtain the handle of an iwin32 process.
RtOpenSemaphore enables multiple processes to open handles of the same semaphore object. The function succeeds only if a process already created the semaphore by using RtCreateSemaphore. The calling process can use the returned handle in any function that requires a handle to a semaphore object, such as the wait functions.
To close the handle, use RtCloseHandle. When the process terminates, the system automatically closes the handle. After the last handle closes, the semaphore object is destroyed.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/nt/include/iwin32x.h | iwin32x.h | iwin32x.lib |
Notes
RtCloseHandle, RtCreateSemaphore, iwin32x API, iwin32 Overview