// wdfrequest.h
EVT_WDF_REQUEST_COMPLETION_ROUTINE EvtWdfRequestCompletionRoutine;
VOID EvtWdfRequestCompletionRoutine(
[in] WDFREQUEST Request,
[in] WDFIOTARGET Target,
[in] PWDF_REQUEST_COMPLETION_PARAMS Params,
[in] WDFCONTEXT Context
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
A driver's CompletionRoutine event callback function executes when another driver completes a specified I/O request.
Request [in]A handle to a framework request object that represents the completed I/O request.
Target [in]A handle to an I/O target object that represents the I/O target that completed the request.
Params [in]A pointer to a WDF_REQUEST_COMPLETION_PARAMS structure that contains information about the completed request. See note below regarding validity of the completion parameters.
Context [in]Driver-supplied context information, which the driver specified in a previous call to WdfRequestSetCompletionRoutine.
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.
The completion parameters structure is fully populated with valid information only if the driver formatted the request by calling one of the following:
If the driver formatted the request using either WdfRequestFormatRequestUsingCurrentType or WdfRequestWdmFormatUsingStackLocation, only the IoStatus field in the completion parameters structure is valid.
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.
typedef VOID
(EVT_WDF_REQUEST_COMPLETION_ROUTINE)(
IN WDFREQUEST Request,
IN WDFIOTARGET Target,
IN PWDF_REQUEST_COMPLETION_PARAMS Params,
IN WDFCONTEXT Context
);
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:
EVT_WDF_REQUEST_COMPLETION_ROUTINE MyCompletionRoutine;
Then, implement your callback function as follows:
VOID
MyCompletionRoutine (
IN WDFREQUEST Request,
IN WDFIOTARGET Target,
IN PWDF_REQUEST_COMPLETION_PARAMS Params,
IN WDFCONTEXT Context
)
{...}
WdfRequestSetCompletionRoutine