1.3.5  Driver Threads, Dispatcher Objects, and Resources

KeDelayExecutionThread

Puts the current thread into an alertable or nonalertable wait state for a given interval.

ExInitializeWorkItem

Initializes a work queue item with a caller-supplied context and callback routine to be queued for execution when a system worker thread is given control.

ExQueueWorkItem

Queues an initialized work queue item so the driver-supplied routine will be called when a system worker thread is given control.

ExInitializeResourceLite

Initializes a resource, for which the caller provides the storage, to be used for synchronization by a set of threads (shared readers, exclusive writers).

ExReinitializeResourceLite

Reinitializes an existing resource variable.

ExAcquireResourceExclusiveLite

Acquires an initialized resource for exclusive access by the calling thread and optionally waits for the resource to be acquired.

ExTryToAcquireResourceExclusiveLite

Either acquires a given resource for exclusive access immediately or returns FALSE.

ExAcquireResourceSharedLite

Acquires an initialized resource for shared access by the calling thread and optionally waits for the resource to be acquired.

ExAcquireSharedStarveExclusive

Acquires a given resource for shared access without waiting for any pending attempts to acquire exclusive access to the same resource.

ExAcquireSharedWaitForExclusive

Acquires a given resource for shared access, optionally waiting for any pending exclusive waiters to acquire and release the resource first.

ExIsResourceAcquiredExclusiveLite

Returns whether the calling thread has exclusive access to a given resource.

ExIsResourceAcquiredSharedLite

Returns how many times the calling thread has acquired shared access to a given resource.

ExGetExclusiveWaiterCount

Returns the number of threads currently waiting to acquire a given resource for exclusive access.

ExGetSharedWaiterCount

Returns the number of threads currently waiting to acquire a given resource for shared access.

ExConvertExclusiveToSharedLite

Converts a given resource from acquired for exclusive access to acquired for shared access.

ExGetCurrentResourceThread

Returns the thread ID of the current thread.

ExReleaseResourceForThreadLite

Releases a given resource that was acquired by the given thread.

ExDeleteResourceLite

Deletes a caller-initialized resource from the system’s resource list.

KeSetTimer

Sets the absolute or relative interval at which a timer object will be set to the Signaled state and optionally supplies a timer DPC to be executed when the interval expires.

KeSetTimerEx

Sets the absolute or relative interval at which a timer object will be set to the Signaled state, optionally supplies a timer DPC to be executed when the interval expires, and optionally supplies a recurring interval for the timer.

KeCancelTimer

Cancels a timer object before the interval passed to KeSetTimer expires; dequeues a timer DPC before the timer interval, if any was set, expires.

KeReadStateTimer

Returns whether a given timer object is set to the Signaled state.

KeSetEvent

Returns the previous state of a given event object and sets the event to the Signaled state if not already Signaled.

KeClearEvent

Resets the event to the Not-Signaled state.

KeResetEvent

Returns the previous state of a given event object and resets the event to the Not-Signaled state.

KeReadStateEvent

Returns the current state (nonzero for Signaled or zero for Not-Signaled) of a given event object.

ExAcquireFastMutex

Acquires an initialized fast mutex, possibly after putting the caller into a wait state until it is acqired, and gives the calling thread ownership with APCs disabled.

ExTryToAcquireFastMutex

Either acquires the given fast mutex immediately for the caller with APCs disabled or returns FALSE.

ExReleaseFastMutex

Releases ownership of a fast mutex that was acquired with ExAcquireFastMutex or ExTryToAcquireFastMutex.

ExAcquireFastMutexUnsafe

Acquires an initialized fast mutex, possibly after putting the caller into a wait state until it is acquired.

ExReleaseFastMutexUnsafe

Releases ownership of a fast mutex that was acquired with ExAcquireFastMutexUnsafe.

KeReleaseMutex

Releases a given mutex object, specifying whether the caller will call one of the KeWaitXxx routines as soon as KeReleaseMutex returns the previous value of the mutex state (a zero for Signaled; otherwise, Not-Signaled).

KeReadStateMutex

Returns the current state (one for Signaled or any other value for Not-Signaled) of a given mutex object.

KeReleaseSemaphore

Releases a given semaphore object, supplying a (runtime) priority boost for waiting threads if the release sets the semaphore to the Signaled state, augmenting the semaphore count by a given value, and specifying whether the caller will call one of the KeWaitXxx routines as soon as KeReleaseSemaphore returns.

KeReadStateSemaphore

Returns the current state (zero for Not-Signaled or a positive value for Signaled) of a given semaphore object.

KeWaitForSingleObject

Puts the current thread into an alertable or nonalertable wait state until a given dispatcher object is set to the Signaled state or (optionally) until the wait times out.

KeWaitForMutexObject

Puts the current thread into an altertable or nonalertable wait state until a given mutex is set to the Signaled state or (optionally) until the wait times out.

KeWaitForMultipleObjects

Puts the current thread into an alertable or nonalertable wait state until any one or all of a number of dispatcher objects are set to the Signaled state or (optionally) until the wait times out.

IoGetCurrentProcess

Returns a handle for the process of the current thread.

PsGetCurrentProcess

Returns a pointer to the process of the current thread.

KeEnterCriticalRegion

Temporarily disables the delivery of special kernel APCs while a highest-level driver is running in the context of the user-mode thread that requested the current I/O operation.

KeLeaveCriticalRegion

Re-enables the delivery of special kernel APCs again as soon as possible.

ZwSetInformationThread

Sets the priority of a given thread for which the caller has a handle.