RtkOpenSemaphore
RtkOpenSemaphore returns a handle of an existing named semaphore object.
Syntax
HANDLE RTKAPI RtkOpenSemaphore( RTSSINST RtssInst, PHANDLE SemaphoreHandle, ULONG DesiredAccess, BOOLEAN InheritHandle, PUNICODE_STRING Name );
Parameters
RtssInst
An RTSSINST value returned from a call to RtkRtssAttach or RtkRtssAttachEx. Must pass in a valid RTSSINST value or the call will fail with STATUS_INVALID_PARAMETER.
SemaphoreHandle
A pointer to a handle that will receive a handle to the existing semaphore object. Must pass in a valid pointer to a handle or the call will fail with STATUS_INVALID_PARAMETER.
DesiredAccess (ignored)
The requested access to the semaphore object.
InheritHandle (ignored)
The handle to inherit.
Name
A pointer to a PUNICODE_STRING specifying the name of the semaphore object. The name is limited to 260 characters and can contain any character except the backslash path-separator character (\). Name comparison is case-sensitive.
Return Value
RtkOpenSemaphore returns STATUS_SUCCESS on success or on failure one of the following NTSTATUS error codes is possible:
- STATUS_INVALID_PARAMETER
- STATUS_UNSUCCESSFUL
- STATUS_INVALID_HANDLE
- STATUS_NO_SUCH_DEVICE
Remarks
RtkOpenSemaphore enables multiple processes to open handles of the same semaphore object. The function succeeds only if some process has already created the semaphore by using RtkCreateSemaphore. The calling process can use the returned handle in any function that requires a handle of a semaphore object, such as a wait function, subject to the limitations of the access specified in DesiredAccess.
Use RtkCloseHandle to close the handle. The system closes the handle automatically when the process terminates. The semaphore object is destroyed when its last handle has been closed.
Requirements
Minimum Supported Version | RTX64 2013 with Service Pack 1 |
Header | RtkApi.h |
Library | RtkApi.lib |
IRQL | PASSIVE_LEVEL |
See Also: