Previous Next

Writing DPC Routines

The primary responsibilities of DpcForIsr and CustomDpc routines are ensuring that the next device I/O operation is started promptly and completing the current IRP.

Additional work done by any DpcForIsr or CustomDpc routine depends on the driver’s design and the nature of the device. For example, a DpcForIsr or CustomDpc routine also can do any of the following:

Note that a DpcForIsr or CustomDpc routine usually does most of the driver’s device I/O processing to satisfy IRPs. These routines also share some of the responsibility for queuing IRPs to the device with the driver’s dispatch routines.

Consider the following a general design guidelines.

A DpcForIsr or CustomDpc routine must call IoStartNextPacket, or otherwise notify the appropriate driver routine when device I/O processing for the next request can be started. Depending on the driver and its device, this can occur well before the DpcForIsr or CustomDpc routine completes the current IRP with IoCompleteRequest, or it can occur immediately before this routine completes the current IRP and returns control.