Previous Next

KeAcquireInStackQueuedSpinLockAtDpcLevel

The KeAcquireInStackQueuedSpinLockAtDpcLevel routine acquires a queued spin lock when the caller is already running at an IRQL = DISPATCH_LEVEL.

NTKERNELAPI
VOID
FASTCALL
  KeAcquireInStackQueuedSpinLockAtDpcLevel (
    IN PKSPIN_LOCK  SpinLock,
    IN PKLOCK_QUEUE_HANDLE  LockHandle
    );

Parameters

SpinLock
Specifies the spin lock to acquire. This parameter must have been initialized with KeInitializeSpinLock.
LockHandle
Pointer to a caller-supplied KLOCK_QUEUE_HANDLE structure that the routine can use to return the spin lock queue handle. The caller passes this value to KeReleaseInStackQueuedSpinLockFromDpcLevel.

Return Value

None

Headers

Declared in ntddk.h. Include ntddk.h.

Comments

This routine is only available in Windows XP and later.

For a driver running at IRQL = DISPATCH_LEVEL, KeAcquireInStackQueuedSpinLockAtDpcLevel acquires a spin lock as a queued spin lock. Queued spin locks are a more efficient version of spin locks. For more information, see Queued Spin Locks. The caller releases the spin lock with KeReleaseInStackQueuedSpinLockFromDpcLevel.

Drivers that are already running at an IRQL = DISPATCH_LEVEL can call this routine to acquire the queued spin lock more quickly. Otherwise, use KeAcquireInStackQueuedSpinLock to acquire the spin lock.

Like ordinary spin locks, queued spin locks must only be used in very special circumstances. For a description of when to use spin locks, see KeAcquireSpinLock.

Drivers must not combine calls to KeAcquireSpinLock and KeAcquireInStackQueuedSpinLock on the same spin lock. A spin lock must always be acquired or released as either a queued spin lock, or as an ordinary spin lock.

See Also

KeAcquireSpinLock, KeAcquireInStackQueuedSpinLock, KeInitializeSpinLock, KeReleaseInStackQueuedSpinLockFromDpcLevel