Previous Next

CustomDPC

The CustomDpc routine finishes the servicing of an I/O operation, after an InterruptService routine returns.

VOID
  CustomDPC(
    IN struct _KDPC  *Dpc,
    IN PVOID  DeferredContext,
    IN PVOID  SystemArgument1,
    IN PVOID  SystemArgument2
    );

Parameters

Dpc
Caller-supplied pointer to a KDPC structure, which represents the DPC object that is associated with this CustomDpc routine.
DeferredContext
Caller-supplied pointer to driver-defined context information that was specified in a previous call to KeInitializeDpc.
SystemArgument1
Caller-supplied pointer to driver-supplied information that was specified in a previous call to KeInsertQueueDpc.
SystemArgument2
Caller-supplied pointer to driver-supplied information that was specified in a previous call to KeInsertQueueDpc.

Return Value

None

Comments

A driver's CustomDpc routine executes in a DPC context, at IRQL = DISPATCH_LEVEL.

To create a DPC object and register a CustomDpc routine for that object, a driver must call KeInitializeDPC. (If you need only one DPC routine, you can use a DpcForIsr routine and the system-allocated DPC object.)

To queue a CustomDpc routine for execution, a driver's InterruptService routine must call KeInsertQueueDpc.

One or more CustomDpc routines can be used instead of, or in conjunction with, a DpcForIsr routine. A driver that maintains several internal IRP queues typically supplies a CustomDpc routine for each queue. Each CustomDpc routine is typically responsible for at least the following tasks:

A CustomDpc routine might also retry a failed operation or set up the next transfer for a large I/O request that is broken into smaller pieces.

For more information about CustomDpc routines, see DPC Objects and DPCs.