IoCreateNotificationEvent - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

PKEVENT IoCreateNotificationEvent(
  [in]  PUNICODE_STRING EventName,
  [out] PHANDLE         EventHandle
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-iocreatenotificationevent)

IoCreateNotificationEvent function

Description

The IoCreateNotificationEvent routine creates or opens a named notification event used to notify one or more threads of execution that an event has occurred.

Parameters

EventName [in]

Pointer to a buffer containing a null-terminated Unicode string that names the event.

EventHandle [out]

Pointer to a location in which to return a kernel handle for the event object.

Return value

IoCreateNotificationEvent returns a pointer to the created or opened event object or NULL if the event object could not be created or opened.

Remarks

If the event object does not already exist, IoCreateNotificationEvent creates and opens it, and sets its state to Signaled.

If the event object already exists, IoCreateNotificationEvent just opens the event object.

Both notification events and synchronization events are used to coordinate execution. However, while a synchronization event resets itself, a notification event remains in the Signaled state until the driver calls KeClearEvent or KeResetEvent.

To synchronize on a notification event:

  1. Open the notification event with IoCreateNotificationEvent. Identify the event with the EventName string.
  2. Wait for the event to be signaled by calling KeWaitForSingleObject with the PKEVENT returned by IoCreateNotificationEvent. More than one thread of execution can wait for a given notification event. To poll instead of stall, specify a Timeout of zero to KeWaitForSingleObject.
  3. Close the handle to the notification event with ZwClose when access to the event is no longer needed.

There are two main methods for sharing event objects:

For more information about events, see Event Objects.

See also

IoCreateSynchronizationEvent

KeClearEvent

KeResetEvent

KeSetEvent

KeWaitForSingleObject

RtlInitUnicodeString

ZwClose