RtkReleaseSemaphore

RtkReleaseSemaphore increases the count of the specified semaphore object by a specified amount.

Syntax

NTSTATUS RTKAPI RtkReleaseSemaphore(
    RTSSINST RtssInst,
    HANDLE SemaphoreHandle,
    LONG ReleaseCount,
    PLONG PreviousCount
);

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

The handle which identifies the sempahore object as returned by a preceding call to RtkCreateSemaphore or RtkOpenSemaphore.

ReleaseCount

The amount by which the semaphore object's current count is to be increased. The value must be greater than zero. If the specified amount would cause the semaphore's count to exceed the maximum count that was specified when the semaphore was created, the count is not changed and the function returns STATUS_SEMAPHORE_LIMIT_EXCEEDED.

PreviousCount

A pointer to a variable receives the previous count for the semaphore. This parameter can be NULL if the previous count is not required.

Return Value

RtkReleaseSemaphore rreturns STATUS_SUCCESS on success or on failure one of the following NTSTATUS error codes is possible:

Remarks

The state of a semaphore object is signaled when its count is greater than zero and non-signaled when its count is equal to zero. The process that calls RtkCreateSemaphore specifies the semaphore's initial count. Each time a waiting thread is released because of the semaphore's signaled state, the count of the semaphore is decreased by one.

Requirements

Minimum Supported Version RTX64 2013 with Service Pack 1
Header RtkApi.h
Library RtkApi.lib
IRQL PASSIVE_LEVEL

See Also:

RtkCreateSemaphore

RtkOpenSemaphore

RtkWaitForSingleObject

RtkWaitForMultipleObjects