Previous Next

KeInitializeDpc

The KeInitializeDpc routine initializes a DPC object, setting up a deferred procedure that can be called with a given context.

VOID 
  KeInitializeDpc(
    IN PRKDPC  Dpc,
    IN PKDEFERRED_ROUTINE  DeferredRoutine,
    IN PVOID  DeferredContext
    );

Parameters

Dpc
Pointer to a DPC object for which the caller provides the storage.
DeferredRoutine
Specifies the entry point for a routine to be called when the DPC object is removed from the DPC queue. A DeferredRoutine is declared as follows:
VOID
(*PKDEFERRED_ROUTINE)(
    IN PKDPC Dpc,
    IN PVOID DeferredContext,
    IN PVOID SystemArgument1,
    IN PVOID SystemArgument2
    );
 
DeferredContext
Pointer to a caller-supplied context to be passed to the DeferredRoutine when it is called.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

The caller can queue an initialized DPC with KeInsertQueueDpc. The caller also can set up a timer object associated with the initialized DPC object and queue the DPC with KeSetTimer.

Storage for the DPC object must be resident: in the device extension of a driver-created device object, in the controller extension of a driver-created controller object, or in nonpaged pool allocated by the caller.

Callers of this routine must be running at IRQL = PASSIVE_LEVEL.

See Also

KeInsertQueueDpc, KeRemoveQueueDpc, KeSetTimer