Expand Minimize

WdfRequestSetInformation method

[Applies to KMDF and UMDF]

The WdfRequestSetInformation method sets completion status information for a specified I/O request.

Syntax


VOID WdfRequestSetInformation(
  [in]  WDFREQUEST Request,
  [in]  ULONG_PTR Information
);

Parameters

Request [in]

A handle to a framework request object.

Information [in]

Driver-defined completion status information for the request.

Return value

None.

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

Remarks

Framework-based drivers use the WdfRequestSetInformation method to supply driver-specific information that is associated with the completion of an I/O request, such as the number of bytes transferred. Other drivers can obtain this information by calling WdfRequestGetInformation.

Drivers can also specify completion status information by calling WdfRequestCompleteWithInformation.

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

Examples

The following code example sets request completion information that is based on the value of the I/O control code that an EvtIoDeviceControl callback function receives.


VOID
MyEvtIoDeviceControl(
    IN WDFQUEUE  Queue,
    IN WDFREQUEST  Request,
    IN size_t  OutputBufferLength,
    IN size_t  InputBufferLength,
    IN ULONG  IoControlCode
    )
{
    switch (IoControlCode) {
      case MY_IOCTL_CODE_1:
            WdfRequestSetInformation(
                                     Request,
                                     VALUE_1
                                     );
            break;
            status = STATUS_SUCCESS;
      case MY_IOCTL_CODE_2:
            WdfRequestSetInformation(
                                     Request,
                                     VALUE_2
                                     );
            break;
            status = STATUS_SUCCESS;
      case MY_IOCTL_CODE_3:
            WdfRequestSetInformation(
                                     Request,
                                     VALUE_3
                                     );
            status = STATUS_SUCCESS;
            break;
      default:
        status = STATUS_INVALID_DEVICE_REQUEST;
        break;
    }
    WdfRequestComplete(
                       Request,
                       status
                       );
}

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

See also

WdfRequestCompleteWithInformation
WdfRequestGetInformation

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft