WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS function (wdfusb.h)
[Applies to KMDF and UMDF]
The WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS function initializes a WDF_USB_CONTROL_SETUP_PACKET structure for a device class-specific USB control transfer.
void WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS(
[out] PWDF_USB_CONTROL_SETUP_PACKET Packet,
[in] WDF_USB_BMREQUEST_DIRECTION Direction,
[in] WDF_USB_BMREQUEST_RECIPIENT Recipient,
[in] BYTE Request,
[in] USHORT Value,
[in] USHORT Index
);
[out] Packet
A pointer to a WDF_USB_CONTROL_SETUP_PACKET structure.
[in] Direction
A WDF_USB_BMREQUEST_DIRECTION-typed value that is stored in the Packet.bm.Request.Dir member of the WDF_USB_CONTROL_SETUP_PACKET structure.
[in] Recipient
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.
[in] Request
A request type constant that is stored in thePacket.bRequest member of the WDF_USB_CONTROL_SETUP_PACKET structure.
[in] Value
A request-specific value that is stored in the Packet.wValue.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.
[in] Index
A request-specific index value that is stored in the Packet.wIndex.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.
None
The WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS function does the following:
- Zeros the WDF_USB_CONTROL_SETUP_PACKET structure.
- Sets the Packet.bm.Request.Type member to BmRequestClass.
- Sets other structure members by using the WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS function's input arguments.
- WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS
The following code example initializes a WDF_USB_CONTROL_SETUP_PACKET structure.
WDF_USB_CONTROL_SETUP_PACKET packet;
WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS(
&packet,
BMREQUEST_HOST_TO_DEVICE,
BMREQUEST_TO_DEVICE,
0,
0,
0
);
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdfusb.h (include Wdfusb.h) |
WDF_USB_CONTROL_SETUP_PACKET_INIT
WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE