Funzione WdfUsbInterfaceGetConfiguredPipe (wdfusb.h)

[Si applica a KMDF e UMDF]

Il metodo WdfUsbInterfaceGetConfiguredPipe restituisce un handle all'oggetto pipe del framework associato a un'interfaccia del dispositivo USB e a un indice pipe specificati. Facoltativamente, il metodo restituisce anche informazioni sulla pipe.

Sintassi

WDFUSBPIPE WdfUsbInterfaceGetConfiguredPipe(
  [in]                WDFUSBINTERFACE           UsbInterface,
  [in]                UCHAR                     PipeIndex,
  [in, out, optional] PWDF_USB_PIPE_INFORMATION PipeInfo
);

Parametri

[in] UsbInterface

Handle per un oggetto interfaccia USB ottenuto chiamando WdfUsbTargetDeviceGetInterface.

[in] PipeIndex

Indice in base zero nel set di oggetti pipe del framework associati all'oggetto interfaccia specificato.

[in, out, optional] PipeInfo

Puntatore a una struttura WDF_USB_PIPE_INFORMATION allocata dal chiamante che il framework inserisce. Questo parametro è facoltativo e può essere NULL.

Valore restituito

Se l'operazione ha esito positivo, WdfUsbInterfaceGetConfiguredPipe restituisce un handle all'oggetto pipe del framework associato all'oggetto interfaccia e all'indice della pipe specificati. Il metodo restituisce NULL se le dimensioni della struttura WDF_USB_PIPE_INFORMATION non sono corrette o se il valore dell'indice della pipe è troppo grande.

Se il driver fornisce un handle di oggetto non valido, si verifica un controllo di bug.

Commenti

Il driver può chiamare WdfUsbInterfaceGetConfiguredPipe dopo aver chiamato WdfUsbTargetDeviceSelectConfig.

Per altre informazioni sul metodo WdfUsbInterfaceGetConfiguredPipe e sulle destinazioni di I/O USB, vedere Destinazioni di I/O USB.

Esempio

L'esempio di codice seguente invia una richiesta di interruzione USB a ogni pipe configurata di un'interfaccia USB specificata.

BYTE  count, i;
NTSTATUS  status;

count = WdfUsbInterfaceGetNumConfiguredPipes(UsbInterface);

for (i = 0; i < count; i++) {
    WDFUSBPIPE pipe;
    pipe = WdfUsbInterfaceGetConfiguredPipe(
                                            UsbInterface,
                                            i,
                                            NULL
                                            );
    status = WdfUsbTargetPipeAbortSynchronously(
                                            pipe,
                                            WDF_NO_HANDLE,
                                            NULL
                                            );

    if (!NT_SUCCESS(status)) {
        break;
    }
}

Requisiti

Requisito Valore
Piattaforma di destinazione Universale
Versione KMDF minima 1,0
Versione UMDF minima 2,0
Intestazione wdfusb.h (include Wdfusb.h)
Libreria Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <=DISPATCH_LEVEL
Regole di conformità DDI DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf), UsbKmdfIrql(kmdf), UsbKmdfIrql2(kmdf), UsbKmdfIrqlExplicit(kmdf)

Vedi anche

WDF_USB_PIPE_INFORMATION

WdfUsbInterfaceGetNumConfiguredPipes

WdfUsbTargetDeviceGetInterface

WdfUsbTargetDeviceSelectConfig