The KeAcquireInStackQueuedSpinLockAtDpcLevel routine acquires a queued spin lock when the caller is already running at IRQL >= DISPATCH_LEVEL.
VOID KeAcquireInStackQueuedSpinLockAtDpcLevel( _Inout_ PKSPIN_LOCK SpinLock, _Out_ PKLOCK_QUEUE_HANDLE LockHandle );
- SpinLock [in, out]
Specifies the spin lock to acquire. This parameter must have been initialized by a call to the KeInitializeSpinLock routine.
- LockHandle [out]
Pointer to a caller-supplied KLOCK_QUEUE_HANDLE structure that the routine can use to return the spin lock queue handle. To release the lock, the caller passes this value to the KeReleaseInStackQueuedSpinLockFromDpcLevel routine.
For a driver running at IRQL >= DISPATCH_LEVEL, KeAcquireInStackQueuedSpinLockAtDpcLevel acquires a spin lock as a queued spin lock. For more information, see Queued Spin Locks. To release the spin lock, call the KeReleaseInStackQueuedSpinLockFromDpcLevel routine.
Drivers that are already running at an IRQL >= DISPATCH_LEVEL can call this routine to acquire the queued spin lock more quickly. Otherwise, use the KeAcquireInStackQueuedSpinLock routine to acquire the spin lock.
For a driver that is running at IRQL > DISPATCH_LEVEL, this routine acquires the lock without modifying the current IRQL. For a driver that is running at IRQL = DISPATCH_LEVEL, this routine improves performance by acquiring the lock without first setting the IRQL to DISPATCH_LEVEL, which, in this case, would be a redundant operation.
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 either as a queued spin lock, or as an ordinary spin lock.
|Available in Windows XP and later versions of Windows.|
|>= DISPATCH_LEVEL (see Remarks section)|
DDI compliance rules