#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)
/**
* The NtCreateEvent routine creates an event object, sets the initial state of the event to the specified value,
* and opens a handle to the object with the specified desired access.
*
* @param EventHandle A pointer to a variable that receives the event object handle.
* @param DesiredAccess The access mask that specifies the requested access to the event object.
* @param ObjectAttributes A pointer to an OBJECT_ATTRIBUTES structure that specifies the object attributes.
* @param EventType The type of the event, which can be SynchronizationEvent or a NotificationEvent.
* @param InitialState The initial state of the event object.
* @return NTSTATUS Successful or errant status.
* @see https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-zwcreateevent
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateEvent(
_Out_ PHANDLE EventHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ EVENT_TYPE EventType,
_In_ BOOLEAN InitialState
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateEvent(
_Out_ PHANDLE EventHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
_In_ EVENT_TYPE EventType,
_In_ BOOLEAN InitialState
);
View code on GitHub
This function is documented in Windows Driver Kit.
Result of call - HANDLE
to newly created Event Object.
Assess rights associated with created event. Can be one of following values from <winnt.h>:
Optional name of Event Object for multiprocess use.
See EVENT_TYPE
for details.
State of event immediately after creation.