WdfDpcEnqueue function (wdfdpc.h)

[Applies to KMDF only]

The WdfDpcEnqueue method schedules the execution of a DPC object's EvtDpcFunc callback function.


BOOLEAN WdfDpcEnqueue(
  [in] WDFDPC Dpc


[in] Dpc

A handle to a framework DPC object.

Return value

WdfDpcEnqueue returns TRUE if it successfully adds the specified DPC object to the system's DPC queue. Otherwise, the method returns FALSE.

A bug check occurs if the driver supplies an invalid object handle.


The WdfDpcEnqueue method adds the specified DPC object to the system's DPC queue, if it is not already in the queue. (If the DPC object was already in the queue, the method returns FALSE.) When the system is not executing higher-priority tasks, it removes the DPC object from the queue and calls the object's EvtDpcFunc callback function.

After the callback function executes, a subsequent call to WdfDpcEnqueue will add the DPC object back into the DPC queue.

For more information about using DPC objects, see Servicing an Interrupt.


The following code example schedules the execution of the callback function that is associated with a DPC object. The example uses the WdfDpcEnqueue method's return value as the containing function's return value. The WdfDpcCreate code example shows how the DPC object was created.

return WdfDpcEnqueue(PDevExt->CompleteWriteDpc);


Target Platform Universal
Minimum KMDF version 1.0
Header wdfdpc.h (include Wdf.h)
Library Wdf01000.sys (see Framework Library Versioning.)
IRQL Any level
DDI compliance rules DriverCreate, KmdfIrql, KmdfIrql2

See also