Expand Minimize

WdfRequestFormatRequestUsingCurrentType method

[Applies to KMDF and UMDF]

The WdfRequestFormatRequestUsingCurrentType method formats a specified I/O request so that the driver can forward it, unmodified, to the driver's local I/O target.

Syntax


VOID WdfRequestFormatRequestUsingCurrentType(
  [in]  WDFREQUEST Request
);

Parameters

Request [in]

A handle to a framework request object that the driver received from one of its I/O queues.

Return value

None.

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

Remarks

When your driver receives an I/O request, sometimes you will want the driver to forward the request, unmodified, to its local I/O target. To forward such a request, the driver must:

  1. Call WdfRequestFormatRequestUsingCurrentType to format the request object so that the framework can pass the request to the driver's local I/O target.

  2. Call WdfRequestSend to send the request to the I/O target.

For more information about WdfRequestFormatRequestUsingCurrentType, see Forwarding I/O Requests.

Examples

The following code example is an EvtIoDefault callback function that forwards every I/O request that it receives, without modification, to the device's local I/O target.


VOID
MyEvtIoDefault(
    WDFQUEUE Queue,
    WDFREQUEST Request
    )
{
    WDF_REQUEST_SEND_OPTIONS options;
    NTSTATUS status;
    WDF_REQUEST_PARAMETERS params;
    BOOLEAN ret;

    WDF_REQUEST_PARAMETERS_INIT(&params);

    WdfRequestGetParameters(
                            Request,
                            &params
                            );

    WdfRequestFormatRequestUsingCurrentType(Request);

    WDF_REQUEST_SEND_OPTIONS_INIT(
                                  &options,
                                  WDF_REQUEST_SEND_OPTION_SEND_AND_FORGET
                                  );

    ret = WdfRequestSend (
                          Request,
                          WdfDeviceGetIoTarget(WdfIoQueueGetDevice(Queue)),
                          &options
                          );
    if (!ret) {
        status = WdfRequestGetStatus(Request);
        WdfRequestComplete(
                           Request,
                           status
                           );
    }
    return;
}

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, RequestFormattedValid

See also

WdfRequestWdmFormatUsingStackLocation
WdfRequestSend

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft