WdfRequestSetCompletionRoutine function

[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_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine,
  _In_opt_ WDFCONTEXT                         CompletionContext
);

Parameters

Request

A handle to a framework request object.

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.

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.

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

Remarks

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

   
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, InvalidReqAccess, InvalidReqAccessLocal, KmdfIrql, KmdfIrql2, ReqCompletionRoutine

See Also

CompletionRoutine

Send comments about this topic to Microsoft