Bewerken

Delen via


WdfRequestSetInformation function (wdfrequest.h)

[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

[in] Request

A handle to a framework request object.

[in] Information

Driver-defined completion status information for the request.

Return value

None

Remarks

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

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
                                     );
            status = STATUS_SUCCESS;                                     
            break;

      case MY_IOCTL_CODE_2:
            WdfRequestSetInformation(
                                     Request,
                                     VALUE_2
                                     );
            status = STATUS_SUCCESS;                                     
            break;

      case MY_IOCTL_CODE_3:
            WdfRequestSetInformation(
                                     Request,
                                     VALUE_3
                                     );
            status = STATUS_SUCCESS;
            break;

      default:
            status = STATUS_INVALID_DEVICE_REQUEST;
            break;
    }

    WdfRequestComplete(
                       Request,
                       status
                       );
}

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

WdfRequestCompleteWithInformation

WdfRequestGetInformation