Expand Minimize

KeReadStateEvent routine

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

Syntax


LONG KeReadStateEvent(
  _In_  PRKEVENT Event
);

Parameters

Event [in]

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

Version

Available starting with Windows 2000.

Header

Wdm.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

IrqlKeDispatchLte, HwStorPortProhibitedDDIs

See also

KeClearEvent
KeInitializeEvent
KeResetEvent
KeSetEvent
KeWaitForSingleObject

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.