WdfRequestSetCompletionRoutine function (wdfrequest.h)

[Applies to KMDF and UMDF]

The WdfRequestSetCompletionRoutine method registers or deregisters a completion routine for the specified framework request object.

Syntax

void WdfRequestSetCompletionRoutine(
  [in]           WDFREQUEST                         Request,
  [in, optional] PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine,
  [in, optional] __drv_aliasesMem WDFCONTEXT        CompletionContext
);

Parameters

[in] Request

A handle to a framework request object.

[in, optional] CompletionRoutine

A pointer to a CompletionRoutine callback function, if the driver is registering a completion routine, or NULL of the driver is deregistering a previously registered completion routine.

[in, optional] CompletionContext

An untyped pointer to driver-defined context information that the framework passes to the CompletionRoutine callback function. This parameter is optional and can be NULL.

Return value

None

Remarks

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

If your driver forwards I/O requests, but if you want your driver to be notified when a lower-level driver completes the request, your driver can provide a CompletionRoutine callback function and call WdfRequestSetCompletionRoutine to register the function. The framework calls the callback function after a lower-level driver completes the I/O request.

For more information about WdfRequestSetCompletionRoutine, see Completing I/O Requests.

Examples

For a code example that uses WdfRequestSetCompletionRoutine, see WdfRequestSend.

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfrequest.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <=DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf), InvalidReqAccess(kmdf), InvalidReqAccessLocal(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), ReqCompletionRoutine(kmdf)

See also

CompletionRoutine