// wdm.h
LONG KeReadStateSemaphore(
[in] PRKSEMAPHORE Semaphore
);
View the official Windows Driver Kit DDI reference
No description available.
The KeReadStateSemaphore routine returns the current state, signaled or not-signaled, of the specified semaphore object.
Semaphore
[in]Pointer to an initialized semaphore object for which the caller provides the storage.
If the return value is zero, the semaphore object is set to a not-signaled state.
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.