KeReadStateEvent function (wdm.h)

The KeReadStateEvent routine returns the current state, signaled or not-signaled, of an event object.

Syntax

LONG KeReadStateEvent(
  [in] PRKEVENT Event
);

Parameters

[in] Event

A pointer to an initialized event object for which the caller provides the storage.

Return value

If the event object is currently set to a signaled state, a nonzero value is returned. Otherwise, zero is returned.

Remarks

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.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), IrqlKeDispatchLte(wdm)

See also

KeClearEvent

KeInitializeEvent

KeResetEvent

KeSetEvent

KeWaitForSingleObject