9.1.3 Basic CustomDpc Routine Requirements

On entry, any context information passed to a CustomDpc routine is driver-determined. That is, the ISR can pass pointers to any relevant context it has set up at SystemArgument1  and/or SystemArgument2 when it calls KeInsertQueueDpc with the Dpc object pointer representing the driver’s CustomDpc routine. Note that a driver must specify a DeferredContext  pointer for its CustomDpc routine when it initializes its DPC object, so such a driver’s ISR also can set up context for the CustomDpc routine at DeferredContext.

Frequently, an ISR passes pointers to the device extension of the target device object for each interrupt-driven I/O operation and a pointer to the current IRP to its CustomDpc routines. Each CustomDpc routine is responsible for completing some task, associated with an interrupt-driven I/O operation, of the driver designer’s choice.

If an NT device driver has no DpcForIsr routine, its CustomDpc routine(s) are responsible for carrying out the same basic operations as a DpcForIsr routine. That is, the driver’s CustomDpc routine(s) are responsible, in general, for the following:

For more information about the functionality of CustomDpc routines, see also Section 9.2.