The KeReadStateEvent routine returns the current state, signaled or not-signaled, of an event object.
NTKERNELAPI LONG KeReadStateEvent( PRKEVENT Event );
A pointer to an initialized event object for which the caller provides the storage.
If the event object is currently set to a signaled state, a nonzero value is returned. Otherwise, zero is returned.
This routine provides an efficient way to poll the signal state of an event. KeReadStateEvent reads the state of the event without synchronizing its access to the event. Do not assume that accesses of an event state by KeReadStateEvent are mutually exclusive of accesses by routines, such as KeSetEvent and KeWaitForSingleObject, that do synchronize their access to the event state.
It is also possible to read the state of an event from a driver's interrupt service routine at DIRQL, if the following conditions are met: the driver's event object is resident (probably in its device extension), and any other function that accesses the event synchronizes its access with the ISR.
For more information about event objects, see Event Objects.
|Windows version||Available starting with Windows 2000.|
|Header||wdm.h (include Ntddk.h)|
|DDI compliance rules||IrqlKeDispatchLte, HwStorPortProhibitedDDIs|