EVT_WDF_REQUEST_COMPLETION_ROUTINE function

[Applies to KMDF and UMDF]

A driver's CompletionRoutine event callback function executes when another driver completes a specified I/O request.

Syntax

EVT_WDF_REQUEST_COMPLETION_ROUTINE EvtWdfRequestCompletionRoutine;

_IRQL_requires_same_ VOID EvtWdfRequestCompletionRoutine(
  WDFREQUEST Request,
  WDFIOTARGET Target,
  PWDF_REQUEST_COMPLETION_PARAMS Params,
  WDFCONTEXT Context
)
{...}

Parameters

Request

A handle to a framework request object that represents the completed I/O request.

Target

A handle to an I/O target object that represents the I/O target that completed the request.

Params

A pointer to a WDF_REQUEST_COMPLETION_PARAMS structure that contains information about the completed request.

Context

Driver-supplied context information, which the driver specified in a previous call to WdfRequestSetCompletionRoutine.

Return Value

None

Remarks

To register a CompletionRoutine callback function for an I/O request, a driver must call WdfRequestSetCompletionRoutine. For more information about this callback function, see Completing I/O Requests.

Note that the completion parameters structure contains valid information only if the driver has formatted the request by calling one of the WdfIoTargetFormatXxx methods. For an example, see WdfIoTargetFormatRequestForRead.

A KMDF driver's CompletionRoutine can run at IRQL <= DISPATCH_LEVEL regardless of the ExecutionLevel specified in the WDF_OBJECT_ATTRIBUTES structure for the I/O request object.

The function type is declared in Wdfrequest.h, as follows.

To define a CompletionRoutine callback function that is named MyCompletionRoutine, you must first provide a function declaration that SDV and other verification tools require, as follows:

Then, implement your callback function as follows:

Requirements

   
Windows Driver kit version
Target platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfrequest.h (include Wdf.h)
Library
IRQL <=DISPATCH_LEVEL
DDI compliance rules

See Also

WdfRequestSetCompletionRoutine
WDF_REQUEST_COMPLETION_PARAMS

Send comments about this topic to Microsoft