WdfIoTargetStart 方法

The WdfIoTargetStart method starts sending queued requests to a local or remote I/O target.

语法

NTSTATUS WdfIoTargetStart(
  [in]  WDFIOTARGET IoTarget
);

参数

IoTarget [in]

A handle to a local or remote I/O target object that was obtained from a previous call to WdfDeviceGetIoTarget or WdfIoTargetCreate, or from a method that a specialized I/O target provides.

返回值

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

返回代码说明
STATUS_INVALID_DEVICE_STATE

The device has been removed.

 

This method also might return other NTSTATUS values.

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

评论

If your driver can detect recoverable device errors, you might want your driver to call WdfIoTargetStop to temporarily stop sending requests, then later call WdfIoTargetStart to resume sending requests.

Additionally, if a driver calls WdfUsbTargetPipeConfigContinuousReader to configure a continuous reader for a USB pipe, the driver's EvtDeviceD0Entry callback function must call WdfIoTargetStart to start the reader.

Your driver must call WdfIoTargetStart and WdfIoTargetStop synchronously. After the driver calls one of these functions, it must not call the other function before the first one returns.

For more information about WdfIoTargetStart, see Controlling a General I/O Target's State.

For more information about I/O targets, see Using I/O Targets.

示例

The following code example shows how an EvtDeviceD0Entry callback function can call WdfIoTargetStart, if the driver uses a continuous reader for a USB pipe.

NTSTATUS
MyEvtDeviceD0Entry(
    IN  WDFDEVICE Device,
    IN  WDF_POWER_DEVICE_STATE PreviousState
)
{
    PDEVICE_CONTEXT  pDeviceContext;
    NTSTATUS  status;

    pDeviceContext = GetMyDeviceContext(Device);

    status = WdfIoTargetStart(WdfUsbTargetPipeGetIoTarget(pDeviceContext->InterruptPipe));

    return status;
}

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfiotarget.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<=DISPATCH_LEVEL

另请参见

EvtDeviceD0Entry
WdfDeviceGetIoTarget
WdfIoTargetCreate
WdfIoTargetStop
WdfUsbTargetPipeConfigContinuousReader

 

 

社区附加资源

添加
显示:
© 2015 Microsoft