Previous Next

Providing ISR Context Information

On entry, an ISR receives a pointer to whatever context area the driver set up when it called IoConnectInterrupt.

Most drivers set the context pointer to the device object that represents the physical device that generates interrupts, or to that device object’s device extension. In the device extension, the driver can store state information for the driver’s ISR and DpcForIsr routine, the latter of which usually does almost all of the I/O processing to satisfy each request that caused the device to interrupt.

Typically, drivers use the device extension to store pointers to each of the device's interrupt objects (returned from calls to IoConnectInterrupt). Drivers also typically store information in the device extension that allows an ISR to determine if an interrupt was issued by a device the ISR supports.

(Alternatively, interrupt object pointers can be stored in nonpaged pool allocated by the driver, or in a controller extension if a non-WDM driver creates a controller object.)