本文介绍 USB 设备特定的注册表项。
Important
本文面向程序员。 如果你的客户遇到 USB 问题,请参阅 修复 Windows 中的 USB-C 问题
用于配置 USB 驱动程序堆栈行为的注册表设置
本文中所述的注册表项位于以下项下:
HKEY_LOCAL_MACHINE
SYSTEM
CurrentControlSet
Control
usbflags
In the vvvvpppprrrr key,
vvvv is a 4-digit hexadecimal number that identifies the vendor
pppp is a 4-digit hexadecimal number that identifies the product
rrrr is a 4-digit hexadecimal number that contains the revision number of the device
供应商 ID、产品 ID 和修订号值是从 USB 设备描述符获取的。 The USB_DEVICE_DESCRIPTOR structure describes a device descriptor.
The following table describes the possible registry entries for the vvvvpppprrrr key. USB 驱动程序堆栈将这些条目视为只读值。
Registry entry
Description
Possible values
osvcREG_BINARY
指示操作系统是否查询设备以获取Microsoft定义的 USB 描述符。 如果以前尝试的 OS 描述符查询成功,则该值包含 OS 字符串描述符中的供应商代码。
0x0000:设备未提供对 Microsoft OS 字符串描述符请求的有效响应。0x01xx: The device provided a valid response to the Microsoft OS string descriptor request, where xx is the bVendorCode contained in the response.
IgnoreHWSerNumREG_BINARY
指示 USB 驱动程序堆栈是否必须忽略设备的序列号。
0x00:该设置已禁用。0x01:强制 USB 驱动程序堆栈忽略设备的序列号。 因此,设备实例会被绑定到设备连接的端口。
ResetOnResumeREG_BINARY
指示当端口从睡眠周期恢复时,USB 驱动程序堆栈是否必须重置设备。
0x0000:设置已禁用。0x0001:强制 USB 驱动程序堆栈在端口恢复时重置设备。
在 Windows 上枚举设备信息后查找设备信息
View the device interface GUID, Hardware ID, and device class information about your device
查找公开你感兴趣的设备接口的设备,并记下实例 ID。 例如,如果设备接口属于类 {A5DCBF10-6530-11D2-901F-00C04FB951ED},则可以使用以下命令找到正确的设备接口和设备:
>pnputil /enum-interfaces /class {A5DCBF10-6530-11D2-901F-00C04FB951ED} /instanceid
Microsoft PnP Utility
Interface Path: \\?\USB#VID_045E&PID_0840#0C33CG9212501N0#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Interface Description: Unknown
Interface Class GUID: {a5dcbf10-6530-11d2-901f-00c04fb951ed}
Device Instance ID: USB\VID_045E&PID_0840\0C33CG9212501N0
Interface Status: Enabled
Interface Path: \\?\USB#VID_045E&PID_07A5#5&109d12e&0&1#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Interface Description: Unknown
Interface Class GUID: {a5dcbf10-6530-11d2-901f-00c04fb951ed}
Device Instance ID: USB\VID_045E&PID_07A5\5&109d12e&0&1
Interface Status: Enabled
检索设备的兼容 ID 列表,并记下设备类、子类和协议代码:
>pnputil /enum-devices /instanceid "USB\VID_045E&PID_0840\0C33CG9212501N0" /ids
Microsoft PnP Utility
Instance ID: USB\VID_045E&PID_0840\0C33CG9212501N0
Device Description: USB Composite Device
Class Name: USB
Class GUID: {36fc9e60-c465-11cf-8056-444553540000}
Manufacturer Name: (Standard USB Host Controller)
Status: Started
Driver Name: usb.inf
Hardware IDs: USB\VID_045E&PID_0840&REV_0215
USB\VID_045E&PID_0840
Compatible IDs: USB\COMPAT_VID_045E&DevClass_00&SubClass_00&Prot00
USB\COMPAT_VID_045E&DevClass_00&SubClass_00
USB\COMPAT_VID_045E&DevClass_00
USB\DevClass_00&SubClass_00&Prot_00
USB\DevClass_00&SubClass_00
USB\DevClass_00
USB\COMPOSITE
Related topics
Microsoft提供的 USB 驱动程序
USB 设备描述符
Windows 中包含的 USB 设备类驱动程序
Microsoft定义的 USB 描述符