Previous Next

KeAcquireInStackQueuedSpinLock

The KeAcquireInStackQueuedSpinLock routine acquires a queued spin lock.

VOID
FASTCALL
  KeAcquireInStackQueuedSpinLock (
    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 variable that the routine can use to return the spin lock queue handle. The caller passes this value to KeReleaseInStackQueuedSpinLock when releasing the lock.

Return Value

None

Headers

Declared in ntddk.h. Include ntddk.h.

Comments

This routine is only available in Windows XP and later.

KeAcquireInStackQueuedSpinLock 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 KeReleaseInStackQueuedSpinLock.

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.

This routine raises the IRQL level to DISPATCH_LEVEL when acquiring the spin lock. If the caller is guaranteed to already be running at DISPATCH_LEVEL, it is more efficient to call KeAcquireInStackQueuedSpinLockAtDpcLevel.

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, KeAcquireInStackQueuedSpinLockAtDpcLevel, KeInitializeSpinLock, KeReleaseInStackQueuedSpinLock