Bewerken

Delen via


WdfRequestGetCompletionParams function (wdfrequest.h)

[Applies to KMDF and UMDF]

The WdfRequestGetCompletionParams method retrieves the I/O completion parameters that are associated with a specified framework request object.

Syntax

void WdfRequestGetCompletionParams(
  [in]      WDFREQUEST                     Request,
  [in, out] PWDF_REQUEST_COMPLETION_PARAMS Params
);

Parameters

[in] Request

A handle to a framework request object.

[in, out] Params

A pointer to a caller-supplied WDF_REQUEST_COMPLETION_PARAMS structure.

Return value

None

Remarks

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

After a driver has called WdfRequestSend to synchronously or asynchronously send an I/O request to an I/O target, and after the I/O target has completed the I/O request, the driver can call WdfRequestGetCompletionParams to obtain the I/O request's completion parameters.

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

Note that if your driver calls one of the methods that sends I/O requests to I/O targets only synchronously (such as WdfIoTargetSendReadSynchronously), the driver must not call WdfRequestGetCompletionParams.

The WdfRequestGetCompletionParams method copies the I/O request's completion parameters into the specified WDF_REQUEST_COMPLETION_PARAMS structure.

If a driver sends an I/O request asynchronously, it typically calls this method from within a CompletionRoutine callback function.

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

Examples

The following code example initializes a WDF_REQUEST_COMPLETION_PARAMS structure and then calls WdfRequestGetCompletionParams.

WDF_REQUEST_COMPLETION_PARAMS completionParams;

WDF_REQUEST_COMPLETION_PARAMS_INIT(&completionParams);
WdfRequestGetCompletionParams(
                              request,
                              &completionParams
                              );

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)

See also

CompletionRoutine

WDF_REQUEST_COMPLETION_PARAMS

WDF_REQUEST_COMPLETION_PARAMS_INIT