#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
* The NtQuerySemaphore routine retrieves information about a semaphore object.
*
* @param SemaphoreHandle A handle to the semaphore object.
* @param SemaphoreInformationClass The type of information to be retrieved.
* @param SemaphoreInformation A pointer to a buffer that receives the requested information.
* @param SemaphoreInformationLength The size of the buffer pointed to by SemaphoreInformation.
* @param ReturnLength A pointer to a variable that receives the size of the data returned in the buffer.
* @return NTSTATUS Successful or errant status.
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQuerySemaphore(
_In_ HANDLE SemaphoreHandle,
_In_ SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
_Out_writes_bytes_(SemaphoreInformationLength) PVOID SemaphoreInformation,
_In_ ULONG SemaphoreInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQuerySemaphore(
_In_ HANDLE SemaphoreHandle,
_In_ SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
_Out_writes_bytes_(SemaphoreInformationLength) PVOID SemaphoreInformation,
_In_ ULONG SemaphoreInformationLength,
_Out_opt_ PULONG ReturnLength
);
View code on GitHub
Function NtQuerySemaphore
retrieve semaphore's parameters (see SEMAPHORE_BASIC_INFORMATION
).
HANDLE
to Semaphore Object opened with SEMAPHORE_QUERY_STATE
access.
Information class described in SEMAPHORE_INFORMATION_CLASS
section.
Pointer to user's allocated buffer for result data.
Size of SemaphoreInformation
buffer, in bytes.
Optionally returns required buffer size.