Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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
[in] Request
A handle to a framework request object that the driver received from one of its I/O queues.
Return value
None
Remarks
A bug check occurs if the driver supplies an invalid object handle.
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:
- Call WdfRequestFormatRequestUsingCurrentType to format the request object so that the framework can pass the request to the driver's local I/O target.
- Call WdfRequestSend to send the request to the I/O target.
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;
    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
| 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), RequestFormattedValid(kmdf) |