Expand Minimize

WdfRequestChangeTarget method

[Applies to KMDF and UMDF]

The WdfRequestChangeTarget method verifies that a specified I/O request can be sent to a specified I/O target.

Syntax


NTSTATUS WdfRequestChangeTarget(
  [in]  WDFREQUEST Request,
  [in]  WDFIOTARGET IoTarget
);

Parameters

Request [in]

A handle to a framework request object.

IoTarget [in]

A handle to a framework I/O target object.

Return value

WdfRequestChangeTarget returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return codeDescription
STATUS_INVALID_PARAMETER

An input parameter is invalid.

STATUS_INSUFFICIENT_RESOURCES

There are insufficient system resources to complete the operation.

STATUS_REQUEST_NOT_ACCEPTED

The request's array of I/O stack locations is not large enough to allow the driver to send the request to the I/O target.

 

This method also might return other NTSTATUS values.

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

Remarks

Your driver should call the WdfRequestChangeTarget method before it calls WdfRequestSend, if the driver sends a single I/O request to multiple I/O targets. WdfRequestChangeTarget verifies that the request can be sent to the specified I/O target.

Most drivers send each request to only one device and thus to only one I/O target. A driver either receives the request or it creates a new request by calling WdfRequestCreate.

If the driver is sending the request to one device, it calls WdfDeviceGetIoTarget to determine the device's I/O target and then calls WdfRequestSend to send the request to the target.

If the driver is sending the request to multiple devices, it calls WdfDeviceGetIoTarget for each device to determine the device's I/O target. Before calling WdfRequestSend, the driver must call WdfRequestChangeTarget to ensure that each I/O target is accessible.

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

Examples

The following code example verifies that an I/O request can be sent to a specified device's local I/O target.


NTSTATUS  status;

status = WdfRequestChangeTarget(
                                request,
                                WdfDeviceGetIoTarget(Device)
                                );

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

WdfDeviceGetIoTarget
WdfRequestCreate
WdfRequestSend

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft