本文列出撰寫 Windows 驅動程式模型 (WDM) USB 用戶端驅動程式所需的標頭和程式庫。
To find the header and library for a specific device driver interface (DDI), consult the reference pages in the USB Reference.
Headers
| Header file | Path | Includes | Description |
|---|---|---|---|
| hubbusif.h | Include\km | 定義 USB 埠驅動程式匯出且可供 USB 中樞驅動程式使用的服務。 | |
| usb.h | Include\shared | Defines URB structures for USB Request Blocks (URBs) required by a client driver to send requests to the USB driver stack. | |
| usb100.h | Include\shared | 根據官方 USB 1.0 規範定義 USB 描述符。 | |
| usb200.h | Include\shared | usb100.h | 根據官方 USB 2.0 規範定義 USB 描述符。 |
| usbbusif.h | Include\km | 定義針對 USB 用戶端驅動程式 (FDO) 定義的匯流排介面,該驅動程式想要直接連結至埠驅動程式,而不是直接連結至 Usbd.sys。 | |
| usbdi.h | Include\shared | usb.h usbioctl.h |
定義協助程式宏,以格式化特定類型要求的 URB。 |
| usbdlib.h | Include\km | 定義 USB 用戶端驅動程式用來將要求傳送至 USB 驅動程式堆疊的 DDI。 | |
| usbdrivr.h | Include\km | usb.h usbdlib.h usbioctl.h usbbusif.h |
Defines USB_KERNEL_IOCTL. |
| usbioctl.h | Include\shared | usbiodef.h usb200.h |
定義 USB 驅動程式堆疊所支援的 IOCTL 程式代碼。 包含用戶端驅動程式的核心模式 IOCTL 程式代碼;應用程式的使用者模式 IOCTL 程式代碼。 |
| usbiodef.h | Include\shared | 定義介面和 WMI GUID。 | |
| usbkern.h | Include\km | usbioctl.h | Deprecated. |
| usbrpmif.h | Include\um | usb100.h windef.h winapifamily.h |
定義應用程式註冊本身的函式,以便執行 USB 裝置的驅動程式重新導向作業。 |
| usbspec.h | Include\shared | 根據官方 USB 規格定義裝置驅動程式介面。 | |
| usbuser.h | Include\um | 定義 USB 埠驅動程式所支援的使用者模式 IOCTL 程式代碼。 | |
| winusb.h | Include\um | winapifamily.h winusbio.h |
Defines WinUSB functions exposed by Winusb.dll, which are used by applications that want to send requests to Winusb.sys that is installed as the function driver for a USB device. |
| winusbio.h | Include\shared | winapifamily.h usb.h |
Defines flags for WinUSB functions. |
Libraries
| Library | Path | Description |
|---|---|---|
| usbd.lib |
\Lib\win8\km \Lib\win7\km \Lib\winv6.3\km |
提供協助程式常式,以從 USB 驅動程式堆疊取得資訊,並格式化要求的 URB。 |
| usbrpm.lib |
\Lib\win8\km \Lib\win7\km \Lib\winv6.3\km |
提供應用程式執行作業的函式,以將 Microsoft 提供的驅動程式取代為協力廠商 RPM 驅動程式。 |
| usbdex.lib |
\Lib\win8\km \Lib\win7\km \Lib\winv6.3\km |
提供用戶端驅動程式的協助程式常式,以將要求傳送至基礎 USB 驅動程式堆疊。 程式庫會在建置時載入並靜態連結至用戶端驅動程式模組。 呼叫這些常式的用戶端驅動程式可以在 Windows Vista 和更新版本的 Windows 上執行。 |
| winusb.lib |
\Lib\win8\km \Lib\win8\um \Lib\win7\km \Lib\win7\um \Lib\winv6.3\km \Lib\winv6.3\um |
提供使用者模式用戶端驅動程式或應用程式的函式,以與已載入 Winusb.sys 函式驅動程式的 USB 裝置通訊。 |
Windows 8 中的標頭變更
從適用於 Windows 8 的 Windows 驅動程式套件 (WDK) 開始,標頭檔 usbspec.h 會取代 USBProtocolDefs.h。
新的標頭檔 usbspec.h 會根據官方 USB 規格,為所定義的 DDI 提供通訊協定定義。 標頭檔包含 USB 3.0 規格的 DDI。