Condividi tramite


funzione WDF_USB_CONTROL_SETUP_PACKET_INIT (wdfusb.h)

[Si applica a KMDF e UMDF]

La funzione WDF_USB_CONTROL_SETUP_PACKET_INIT inizializza una struttura WDF_USB_CONTROL_SETUP_PACKET per un trasferimento di controllo USB standard.

Sintassi

VOID WDF_USB_CONTROL_SETUP_PACKET_INIT(
  [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
);

Parametri

[out] Packet

Puntatore a una struttura WDF_USB_CONTROL_SETUP_PACKET.

[in] Direction

Valore WDF_USB_BMREQUEST_DIRECTIONtipizzato archiviato nel membro Packet.bm.Request.Dir della struttura WDF_USB_CONTROL_SETUP_PACKET.

[in] Recipient

Valore WDF_USB_BMREQUEST_RECIPIENT-typed archiviato nel membro Packet.bm.Request.Recipient della struttura WDF_USB_CONTROL_SETUP_PACKET.

[in] Request

Costante del tipo di richiesta archiviata nel membro Packet.bRequest della struttura WDF_USB_CONTROL_SETUP_PACKET.

[in] Value

Valore specifico della richiesta archiviato nel membro Packet.wValue.Value della struttura WDF_USB_CONTROL_SETUP_PACKET.

[in] Index

Valore di indice specifico della richiesta archiviato nel membro Packet.wIndex.Value della struttura WDF_USB_CONTROL_SETUP_PACKET.

Valore restituito

Nessuno

Osservazioni

La funzione WDF_USB_CONTROL_SETUP_PACKET_INIT esegue le operazioni seguenti:

  1. Zeri la struttura WDF_USB_CONTROL_SETUP_PACKET.
  2. Imposta il membro Packet.bm.Request.Type su BmRequestStandard.
  3. Imposta altri membri della struttura utilizzando gli argomenti di input della funzione WDF_USB_CONTROL_SETUP_PACKET_INIT.
Per inizializzare una struttura WDF_USB_CONTROL_SETUP_PACKET, il driver deve chiamare una delle funzioni seguenti:

Esempi

Nell'esempio di codice seguente viene inizializzata una struttura WDF_USB_CONTROL_SETUP_PACKET.

WDF_USB_CONTROL_SETUP_PACKET  packet;

WDF_USB_CONTROL_SETUP_PACKET_INIT(
                                  &packet,
                                  BMREQUEST_HOST_TO_DEVICE,
                                  BMREQUEST_TO_DEVICE,
                                  0,
                                  0,
                                  0
                                  );

Fabbisogno

Requisito Valore
piattaforma di destinazione Universale
versione minima di KMDF 1.0
versione minima di UMDF 2.0
intestazione wdfusb.h (include Wdfusb.h)

Vedere anche

WDF_USB_BMREQUEST_DIRECTION

WDF_USB_BMREQUEST_RECIPIENT

WDF_USB_CONTROL_SETUP_PACKET

WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS

WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE

WDF_USB_CONTROL_SETUP_PACKET_INIT_GET_STATUS

WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR