// wdfusb.h
typedef union _WDF_USB_CONTROL_SETUP_PACKET {
struct {
union {
struct {
BYTE Recipient : 2;
BYTE Reserved : 3;
BYTE Type : 2;
BYTE Dir : 1;
} Request;
BYTE Byte;
} bm;
BYTE bRequest;
union {
struct {
BYTE LowByte;
BYTE HiByte;
} Bytes;
USHORT Value;
} wValue;
union {
struct {
BYTE LowByte;
BYTE HiByte;
} Bytes;
USHORT Value;
} wIndex;
USHORT wLength;
} Packet;
struct {
BYTE Bytes[8];
} Generic;
} WDF_USB_CONTROL_SETUP_PACKET, *PWDF_USB_CONTROL_SETUP_PACKET;
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WDF_USB_CONTROL_SETUP_PACKET structure describes a setup packet for a USB control transfer.
PacketPacket.bmPacket.bm.RequestPacket.bm.Request.RecipientA bit field that is specified by a WDF_USB_BMREQUEST_RECIPIENT-typed value.
Packet.bm.Request.ReservedA reserved bit field. Do not use this member.
Packet.bm.Request.TypeA bit field that is specified by a WDF_USB_BMREQUEST_TYPE-typed value.
Packet.bm.Request.DirA bit field that is specified by a WDF_USB_BMREQUEST_DIRECTION-typed value.
Packet.bm.ByteA byte-sized bitmap that contains the Request.Recipient, Request.Reserved, Request.Type, and Request.Dir bit fields. Use this member as an alternative to specifying the individual bit fields.
Packet.bRequestA request type. Request type constants are defined in Usb100.h. For more information about request types, see the USB specification.
Packet.wValuePacket.wValue.BytesPacket.wValue.Bytes.LowByteThe low byte of a 2-byte, request-specific value. For more information about specifying wValue, see the USB specification.
Packet.wValue.Bytes.HiByteThe high byte of a 2-byte, request-specific value.
Packet.wValue.ValueA 2-byte value that contains the Bytes.LowByte and Bytes.HiByte values. Use this member as an alternative to specifying individual low-byte and high-byte values.
Packet.wIndexPacket.wIndex.BytesPacket.wIndex.Bytes.LowByteThe low byte of a 2-byte, request-specific value. For more information about specifying wValue, see the USB specification.
Packet.wIndex.Bytes.HiByteThe high byte of a 2-byte, request-specific value.
Packet.wIndex.ValueA 2-byte value that contains the Bytes.LowByte and Bytes.HiByte values. Use this member as an alternative to specifying individual low-byte and high-byte values.
Packet.wLengthThe number of bytes to transfer, if applicable. For more information about this value, see the USB specification. The framework sets this value.
GenericGeneric.BytesAn 8-byte value that represents the entire setup packet. You can use this member as an alternative to specifying individual structure members.
The WDF_USB_CONTROL_SETUP_PACKET structure is used as input to the WdfUsbTargetDeviceSendControlTransferSynchronously and WdfUsbTargetDeviceFormatRequestForControlTransfer methods.
To initialize a WDF_USB_CONTROL_SETUP_PACKET structure, the driver should call one of the following functions:
WdfUsbTargetDeviceFormatRequestForControlTransfer
WdfUsbTargetDeviceSendControlTransferSynchronously