DPC Importance Targeted at Current CPU or Non-Targeted Targeted at Different CPU
Low DPC queue length exceeds maximum DPC queue length or DPC request rate is less than minimum DPC request rate or System is idle DPC queue length exceeds maximum DPC queue length or System is idle
Medium Always DPC queue length exceeds maximum DPC queue length or System is idle
High Always Always

Table 1. Rules for Queue-Draining Interrupt Generation

The DDK states that the DPC queue is drained whenever the IRQL drops below DISPATCH_LEVEL. This is actually implemented as a call to an internal interrupt helper function. When an interrupt occurs, control is transferred into the interrupt object that is connected to the interrupt. The code in the interrupt object calls KiInterruptDispatch, which in-turn calls the ISR that is associated with the interrupt. When the ISR returns, KiInterruptDispatch calls the hal function HalEndSystemInterrupt, which is responsible for dropping the IRQL back to its pre-interrupt level. If the IRQL is dropping below DISPATCH_LEVEL and a queue-drain interrupt is pending, then the HAL calls into KiDispatchInterrupt (note that this is a different function from KiInterruptDispatch). KiDispatchInterrupt is the kernel's own internal ISR that handles DISPATCH_LEVEL software interrupts, and it executes DPC queue draining and context switches.



7 из 9