The IoCreateNotificationEvent routine creates or opens a named notification event used to notify one or more threads of execution that an event has occurred.
PKEVENT
IoCreateNotificationEvent(
IN PUNICODE_STRING EventName,
OUT PHANDLE EventHandle
);
IoCreateNotificationEvent returns a pointer to the created or opened event object or NULL if the event object could not be created or opened.
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
IoCreateNotificationEvent creates and opens the event object if it does not already exist. IoCreateNotificationEvent sets the state of a new notification event to Signaled. If the event object already exists, IoCreateNotificationEvent just opens the event object.
When a notification event is set to the Signaled state it remains in that state until it is explicitly cleared.
Notification events, like synchronization events, are used to coordinate execution. Unlike a synchronization event, a notification event is not auto-resetting. Once a notification event is in the Signaled state, it remains in that state until it is explicitly reset (with a call to KeClearEvent or KeResetEvent).
To synchronize on a notification event:
Sharing event objects between user mode and kernel mode requires care. The system creates user-mode event objects relative to the \\BaseNamedObjects object directory, and only those event objects are visible to user-mode programs. The Xxx user-mode event corresponds to the \\BaseNamedObjects\Xxx kernel-mode event. The preferred method to share event objects between user mode and kernel mode is for the user-mode program to create the event object and pass it to the driver through an IOCTL. The \\BaseNamedObjects object directory is not created until the Win32® system initializes. Therefore, drivers that are loaded at boot time cannot create event objects in their DriverEntry routines that are visible to user-mode programs.
For more information on events, see Event Objects.
Callers of IoCreateNotificationEvent must be running at IRQL = PASSIVE_LEVEL.
IoCreateSynchronizationEvent, KeClearEvent, KeResetEvent, KeSetEvent, KeWaitForSingleObject, RtlInitUnicodeString, ZwClose