8.1.1 ISR Performance

Windows NT is quite different from some operating systems with respect to driver ISRs. NT device drivers actually get better performance if their ISRs return control as quickly as possible, rather than attempting to retain control of a CPU and doing as much I/O processing as possible in their ISRs, particularly in SMP machines.

Instead, the ISR should stop its device from interrupting and save any necessary state information about or context for the operation that caused the interrupt in resident memory, usually in the device extension. Then, it should queue the driver’s DpcForIsr routine or a CustomDpc routine to complete the operation at a lower IRQL, usually at IRQL DISPATCH_LEVEL.

The ISR returns a Boolean, indicating whether the driver’s device generated the interrupt, as shown by the declaration. For drivers of devices that share an interrupt vector or DIRQL, each ISR should return FALSE as soon as it determines that its device was not the source of an interrupt.