The KeAcquireInterruptSpinLock routine acquires the spin lock associated with an interrupt object.
NTKERNELAPI
KIRQL
KeAcquireInterruptSpinLock (
IN PKINTERRUPT Interrupt
);
KeAcquireInterruptSpinLock returns the current IRQL at the time the routine is called. This value is passed to KeReleaseInterruptSpinLock when the spin lock is released.
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
Drivers use the interrupt spin lock to synchronize access to memory shared with the interrupt's ISR. The driver can release the spin lock by calling KeReleaseInterruptSpinLock.
Any code that executes while the interrupt spin lock is held does so at IRQL = DIRQL for the specified Interrupt, so it must execute very quickly. For more information, see Using Critical Sections.
It is generally faster to use KeSynchronizeExecution to synchronize access than to use KeAcquireInterruptSpinLock and KeReleaseInterruptSpinLock.
Callers must be running at IRQL <= DIRQL for Interrupt. (This is the value the driver passed as the SynchronizeIrql parameter of IoConnectInterrupt when Interrupt is created.)
IoConnectInterrupt, KeReleaseInterruptSpinLock, KeSynchronizeExecution