信息
您所需的主题如下所示。但此主题未包含在此库中。

WdfUsbTargetDeviceResetPortSynchronously 方法

The WdfUsbTargetDeviceResetPortSynchronously method resets the USB port that is associated with the specified USB device.

语法

NTSTATUS WdfUsbTargetDeviceResetPortSynchronously(
  [in]  WDFUSBDEVICE UsbDevice
);

参数

UsbDevice [in]

A handle to a USB device object that was obtained from a previous call to WdfUsbTargetDeviceCreate.

返回值

WdfUsbTargetDeviceResetPortSynchronously returns the USB I/O target's completion status value if the operation succeeds. Otherwise, this method can return one of the following values:

返回代码说明
STATUS_INVALID_DEVICE_REQUEST

The caller's IRQL was invalid.

 

This method also might return other NTSTATUS values.

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

评论

The WdfUsbTargetDeviceResetPortSynchronously method resets the USB port by sending an IOCTL_INTERNAL_USB_RESET_PORT request.

Before the framework resets the I/O target's USB port, it cancels all I/O requests that remain in the I/O target's queue. The driver must not send additional I/O requests to the I/O target until WdfUsbTargetDeviceResetPortSynchronously returns.

The driver must call WdfIoTargetStop before it calls WdfUsbTargetDeviceResetPortSynchronously. After WdfUsbTargetDeviceResetPortSynchronously returns, the driver can call WdfIoTargetStart.

After a successful reset operation, the bus driver reselects the configuration and any alternate interface settings that the device had before the reset operation occurred.

For more information about the WdfUsbTargetDeviceResetPortSynchronously method and USB I/O targets, see USB I/O Targets.

示例

The following code example resets a specified device's USB port.

NTSTATUS status;

status = WdfUsbTargetDeviceResetPortSynchronously(UsbDevice);

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfusb.h (包括Wdfusb.h)

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

IRQL

PASSIVE_LEVEL

另请参见

WdfUsbTargetDeviceCreate

 

 

社区附加资源

显示:
© 2014 Microsoft