Expand Minimize

KeReadStateSemaphore routine

The KeReadStateSemaphore routine returns the current state, signaled or not-signaled, of the specified semaphore object.

Syntax


LONG KeReadStateSemaphore(
  _In_  PRKSEMAPHORE Semaphore
);

Parameters

Semaphore [in]

Pointer to an initialized semaphore object for which the caller provides the storage.

Return value

If the return value is zero, the semaphore object is set to a not-signaled state.

Remarks

This routine provides an efficient way to poll the signal state of a semaphore. KeReadStateSemaphore reads the state of the semaphore without synchronizing its access to the semaphore. Do not assume that accesses of a semaphore state by KeReadStateSemaphore are mutually exclusive of accesses by routines, such as KeReleaseSemaphore and KeWaitForSingleObject, that do synchronize their access to the semaphore state.

For more information about semaphore objects, see Semaphore Objects.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

Any level

DDI compliance rules

HwStorPortProhibitedDDIs

See also

KeInitializeSemaphore
KeReleaseSemaphore
KeWaitForSingleObject

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.