WdfUsbInterfaceGetEndpointInformation 函式 (wdfusb.h)

[適用於 KMDF 和 UMDF]

WdfUsbInterfaceGetEndpointInformation 方法會擷取指定 USB 裝置端點及其相關聯管道的相關信息。

語法

void WdfUsbInterfaceGetEndpointInformation(
  [in]      WDFUSBINTERFACE           UsbInterface,
  [in]      UCHAR                     SettingIndex,
  [in]      UCHAR                     EndpointIndex,
  [in, out] PWDF_USB_PIPE_INFORMATION EndpointInfo
);

參數

[in] UsbInterface

呼叫 WdfUsbTargetDeviceGetInterface 取得的 USB 介面物件的句柄。

[in] SettingIndex

識別介面之替代設定的索引值。 如需替代設定的詳細資訊,請參閱 USB 規格。

[in] EndpointIndex

索引值,識別與指定介面之指定替代設定相關聯的端點。 (此索引值不是端點 address.)

[in, out] EndpointInfo

架構所填入之呼叫端配置 WDF_USB_PIPE_INFORMATION 結構的指標。

傳回值

備註

如果驅動程式提供無效的物件句柄,就會發生錯誤檢查。

如需 WdfUsbInterfaceGetEndpointInformation 方法和 USB I/O 目標的詳細資訊,請參閱 USB I/O 目標

範例

下列程式代碼範例會取得USB介面支援的端點數目,然後為每個端點呼叫 WdfUsbInterfaceGetEndpointInformation

WDF_USB_PIPE_INFORMATION endPointInfo;
BYTE settingIndex, i;

settingIndex = 0;
numEndpoints = WdfUsbInterfaceGetNumEndpoints(
                                          UsbInterface,
                                          settingIndex
                                          );

for (i = 0; i < numEndpoints; i++){
    WDF_USB_PIPE_INFORMATION_INIT(&endPointInfo);
    WdfUsbInterfaceGetEndpointInformation(
                                          UsbInterface,
                                          settingIndex,
                                          i,
                                          &endPointInfo
                                          );

    //
    // Examine endpoint information here.
    //
...
}

規格需求

需求
目標平台 Universal
最小 KMDF 版本 1.0
最低UMDF版本 2.0
標頭 wdfusb.h (包含 Wdfusb.h)
程式庫 Wdf01000.sys (KMDF) ;WUDFx02000.dll (UMDF)
IRQL <=DISPATCH_LEVEL
DDI 合規性規則 DriverCreate (kmdf) KmdfIrql (kmdf) KmdfIrql2 (kmdf) , KmdfIrqlExplicit (kmdf) , UsbKmdfIrql (kmdf) UsbKmdfIrql2 (kmdf) 、UsbKmdfIrqlExplicit (kmdf)

另請參閱

WDF_USB_PIPE_INFORMATION

WdfUsbInterfaceGetNumEndpoints

WdfUsbTargetDeviceGetInterface