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

WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE 函数

The WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE function initializes a WDF_USB_CONTROL_SETUP_PACKET structure for a USB control transfer that sets or clears a device feature.

语法

VOID WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE(
  __out  PWDF_USB_CONTROL_SETUP_PACKET Packet,
  __in   WDF_USB_BMREQUEST_RECIPIENT BmRequestRecipient,
  __in   USHORT FeatureSelector,
  __in   USHORT Index,
  __in   BOOLEAN SetFeature
);

参数

Packet [out]

A pointer to a WDF_USB_CONTROL_SETUP_PACKET structure.

BmRequestRecipient [in]

A WDF_USB_BMREQUEST_RECIPIENT-typed value that is stored in the Packet.bm.Request.Recipient member of the WDF_USB_CONTROL_SETUP_PACKET structure.

FeatureSelector [in]

A feature-specific value that is stored in the Packet.wValue.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.

Index [in]

A feature-specific index value that is stored in the Packet.wIndex.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.

SetFeature [in]

A Boolean value that, if TRUE, indicates that the specified feature will be set. If FALSE, the specified feature will be cleared.

返回值

None

评论

The WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE function does the following:

  1. Zeros the WDF_USB_CONTROL_SETUP_PACKET structure.

  2. Sets the Packet.bm.Request.Type member to BmRequestStandard.

  3. Sets the Packet.bm.Request.Dir member to BmRequestDeviceToDevice.

  4. Sets the Packet.bRequest member to either a "set feature" or a "clear feature" request value, based on the SetFeature argument.

  5. Sets other structure members by using the WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE function's input arguments.

To initialize a WDF_USB_CONTROL_SETUP_PACKET structure, the driver should call one of the following functions:

示例

The following code example initializes a WDF_USB_CONTROL_SETUP_PACKET structure.

WDF_USB_CONTROL_SETUP_PACKET packet;

WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE(
                                          &packet,
                                          BMREQUEST_TO_DEVICE,
                                          USB_DEVICE_DESCRIPTOR_TYPE,
                                          0,
                                          FALSE
                                          );

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfusb.h (包括Wdfusb.h)

另请参见

WDF_USB_BMREQUEST_RECIPIENT
WDF_USB_CONTROL_SETUP_PACKET
WDF_USB_CONTROL_SETUP_PACKET_INIT
WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS
WDF_USB_CONTROL_SETUP_PACKET_INIT_GET_STATUS
WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR

 

 

社区附加资源

显示:
© 2014 Microsoft