INtime SDK Help
RtOpenSemaphore (iwin32x)
INtime SDK v6 > About INtime > Alternate APIs > iwin32 API > iwin32x API > RtOpenSemaphore (iwin32x)

Searches for an existing semaphore with the given name and returns its handle.

HANDLE RtOpenSemaphore(
    DWORD dwDesiredAccess,
    BOOLEAN bInheritHandle,
    LPCTSTR lpName
);

Parameters

dwDesiredAccess
Ignored.
bInheritHandle
Ignored.
lpName
Pointer to a null-terminated string that specifies the semaphore to open. Name comparisons are case sensitive.

Remarks

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.

Return Values

Handle to semaphore object
Success.
NULL
Failure. For extended error information, see the Windows' GetLastError function.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/iwin32x.h iwin32x.h iwin32x.lib

Notes

See Also

RtCloseHandle, RtCreateSemaphore, iwin32x API, iwin32 Overview