#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateSemaphore(
_Out_ PHANDLE SemaphoreHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
_In_ LONG InitialCount,
_In_ LONG MaximumCount
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateSemaphore(
_Out_ PHANDLE SemaphoreHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
_In_ LONG InitialCount,
_In_ LONG MaximumCount
);
View code on GitHub
Function NtCreateSemaphore
creates Semaphore Object with or without name in Object Namespace, and sets initial and maximum releases number.
Result of call - pointer to HANDLE
to Semaphore Object.
Access rights to Semaphore Object. Can be one of:
Optional pointer to OBJECT_ATTRIBUTES
structure containing semaphore's name.
Initial state of semaphore. Typically the same as MaximumCount
.
Maximum releases number.