NtReleaseSemaphore - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

NTSYSCALLAPI
NTSTATUS
NTAPI
NtReleaseSemaphore(
    _In_ HANDLE SemaphoreHandle,
    _In_ LONG ReleaseCount,
    _Out_opt_ PLONG PreviousCount
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwReleaseSemaphore(
    _In_ HANDLE SemaphoreHandle,
    _In_ LONG ReleaseCount,
    _Out_opt_ PLONG PreviousCount
    );

#endif

View code on GitHub

Function NtReleaseSemaphore increments semaphore's counter, opposite to any waiting function (semaphore is signaled when semaphore's counter is greater then zero).

SemaphoreHandle

HANDLE to Semaphore Object opened with SEMAPHORE_MODIFY_STATE access.

ReleaseCount

Number of increments, typically set to 1.

PreviousCount

Optional pointer to ULONG value receiving semaphore's counter state before call.

Documented by

See also