Expand Minimize

WdfRequestSetCompletionRoutine method

[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]  WDFCONTEXT CompletionContext
);

Parameters

Request [in]

A handle to a framework request object.

CompletionRoutine [in, optional]

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 [in, optional]

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

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

Show:
© 2014 Microsoft. All rights reserved.