ExAcquirePushLockExclusive macro (wdm.h)

Acquires the given push lock for exclusive access by the calling thread.

Syntax

void ExAcquirePushLockExclusive(
   Lock
);

Parameters

Lock

Opaque push lock pointer. This pointer must have been initialized by a previous call to ExInitializePushLock.

Return value

None

Remarks

Push locks are similar to ERESOURCE structures (also called resources) in that they can be acquired for shared or exclusive access. For more information about push locks, see the reference entry for ExInitializePushLock.

Unlike ERESOURCE structures, push locks cannot be acquired recursively. If the caller already has acquired the push lock for exclusive or shared access, the thread hangs. When the caller is given exclusive access to the given push lock, depends on the following:

  • If the push lock is currently unowned, exclusive access is granted immediately to the current thread.

  • If the push lock has already been acquired for exclusive or shared access by another thread, the current thread is put into a wait state until the push lock can be acquired.

Before calling this routine, the driver must disable normal kernel APC delivery by calling KeEnterCriticalRegion. Reenable delivery after the push lock is released by calling KeLeaveCriticalRegion. For more information, see Disabling APCs.

To release the push lock after it is acquired, call ExReleasePushLockExclusive. Every call to ExAcquirePushLockExclusive must be matched by a subsequent call to ExReleasePushLockExclusive.

To acquire a push lock for shared access, call ExAcquirePushLockShared.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1809
Header wdm.h

See also

ExInitializePushLock

KeEnterCriticalRegion

ExReleasePushLockExclusive

ExAcquirePushLockShared