The KeAcquireSpinLockAtDpcLevel routine acquires a spin lock when the caller is already running at IRQL = DISPATCH_LEVEL.
VOID
KeAcquireSpinLockAtDpcLevel(
IN PKSPIN_LOCK SpinLock
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
Drivers for Windows XP and later should use the more efficient and reliable queued spin locks, which are acquired at IRQL = DISPATCH_LEVEL by the KeAcquireInStackQueuedSpinLockAtDpcLevel routine.
Drivers call KeAcquireSpinLockAtDpcLevel instead of KeAcquireSpinLock for better driver performance if and only if they are already running at IRQL = DISPATCH_LEVEL.
If a driver is running at IRQL < DISPATCH_LEVEL, it should call KeAcquireSpinLock to have IRQL raised by that routine. KeAcquireSpinLockAtDpcLevel assumes the caller is already running at IRQL = DISPATCH_LEVEL, so no raise is necessary.
The caller should release the spin lock with KeReleaseSpinLockFromDpcLevel as quickly as possible.
KeAcquireInStackQueuedSpinLockAtDpcLevel, KeAcquireSpinLock, KeInitializeSpinLock, KeReleaseSpinLock, KeReleaseSpinLockFromDpcLevel, KeTryToAcquireSpinLockAtDpcLevel