funzione WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE (wdfusb.h)

[Si applica a KMDF e UMDF]

La funzione WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE inizializza una struttura WDF_USB_CONTROL_SETUP_PACKET per un trasferimento di controllo USB che imposta o cancella una funzionalità del dispositivo.

Sintassi

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
);

Parametri

[out] Packet

Puntatore a una struttura WDF_USB_CONTROL_SETUP_PACKET .

[in] BmRequestRecipient

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

[in] FeatureSelector

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

[in] Index

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

[in] SetFeature

Valore booleano che, se TRUE, indica che verrà impostata la funzionalità specificata. Se FALSE, la funzionalità specificata verrà cancellata.

Valore restituito

nessuno

Osservazioni

La funzione WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE 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 il membro Packet.bm.Request.Dir su BmRequestDeviceToDevice.
  4. Imposta il membro Packet.bRequest su un valore di richiesta "set feature" o "clear feature", in base all'argomento SetFeature .
  5. Imposta altri membri della struttura usando gli argomenti di input della funzione WDF_USB_CONTROL_SETUP_PACKET_INIT_FEATURE .
Per inizializzare una struttura WDF_USB_CONTROL_SETUP_PACKET , il driver deve chiamare una delle funzioni seguenti:

Esempio

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_FEATURE(
                                          &packet,
                                          BMREQUEST_TO_DEVICE,
                                          USB_DEVICE_DESCRIPTOR_TYPE,
                                          0,
                                          FALSE
                                          );

Requisiti

Requisito Valore
Piattaforma di destinazione Universale
Versione KMDF minima 1.0
Versione UMDF minima 2,0
Intestazione wdfusb.h (include Wdfusb.h)

Vedi anche

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