WdfDpcCancel - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdpc.h

BOOLEAN WdfDpcCancel(
  [in] WDFDPC  Dpc,
  [in] BOOLEAN Wait
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdpc-wdfdpccancel)

WdfDpcCancel function

Description

[Applies to KMDF only]

The WdfDpcCancel method attempts to cancel the execution of a DPC object's scheduled EvtDpcFunc callback function.

Parameters

Dpc [in]

A handle to a framework DPC object.

Wait [in]

A Boolean value that, if TRUE, indicates that the WdfDpcCancel method will not return until the DPC object's EvtDpcFunc callback function is either canceled or finishes executing. If FALSE, the WdfDpcCancel method returns immediately.

Return value

WdfDpcCancel returns TRUE if the specified DPC object's EvtDpcFunc callback function was in the system's DPC queue. The method returns FALSE if the callback function was not in the DPC queue, either because the callback function was executing or because it had finished executing.

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

Remarks

If the specified DPC object's EvtDpcFunc callback function is in the system's DPC queue, it is removed from the queue. If the EvtDpcFunc function is not in the queue, it is either executing or has finished executing.

If the Wait parameter is TRUE, WdfDpcCancel must be called at IRQL = PASSIVE_LEVEL. If the Wait parameter is FALSE, WdfDpcCancel can be called at any IRQL.

Examples

The following code example cancels the execution of the callback function that is associated with the DPC object that the code example in the WdfDpcCreate topic created.

WdfDpcCancel(
             PDevExt->CompleteWriteDpc,
             TRUE
             );

See also

EvtDpcFunc