WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS function
[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.
Syntax
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 );
Parameters
- Packet [out]
-
A pointer to a WDF_USB_CONTROL_SETUP_PACKET structure.
- Direction [in]
-
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.
- Recipient [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.
- Request [in]
-
A request type constant that is stored in thePacket.bRequest member of the WDF_USB_CONTROL_SETUP_PACKET structure.
- Value [in]
-
A request-specific value that is stored in the Packet.wValue.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.
- Index [in]
-
A request-specific index value that is stored in the Packet.wIndex.Value member of the WDF_USB_CONTROL_SETUP_PACKET structure.
Return value
None
Remarks
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.
To initialize a WDF_USB_CONTROL_SETUP_PACKET structure, the driver should call one of the following functions:
-
WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS
Examples
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 );
Requirements
Minimum KMDF version | 1.0 |
---|---|
Minimum UMDF version | 2.0 |
Header |
|
See also
- WDF_USB_BMREQUEST_DIRECTION
- WDF_USB_BMREQUEST_RECIPIENT
- WDF_USB_CONTROL_SETUP_PACKET
- WDF_USB_CONTROL_SETUP_PACKET_INIT
- WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE
- WDF_USB_CONTROL_SETUP_PACKET_INIT_GET_STATUS
- WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR