KeAcquireSpinLockAtDpcLevel

VOID
    KeAcquireSpinLockAtDpcLevel(

        IN PKSPIN_LOCK  SpinLock
        );

KeAcquireSpinLockAtDpcLevel acquires a spin lock when the caller is already running at IRQL DISPATCH_LEVEL.

Parameters

SpinLock
Points to an initialized spin lock for which the caller must provide the storage.

Comments

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.

See Also

KeAcquireSpinLock, KeInitializeSpinLock, KeReleaseSpinLock, KeReleaseSpinLockFromDpcLevel