如何使用 MS_OS_20 BOS 描述符获取 Windows 10 以将 WinUSB 自动加载为 driver
How to get Windows 10 to autoload WinUSB as driver using MS_OS_20 BOS descriptor
我正在努力让 Windows 为我的设备加载默认的 WinUSB driver。请注意,我正在寻找使用 BOS 描述符(而不是旧的 0xEE 字符串索引)的解决方案。
设备枚举,Windows 告诉我它正在安装设备,但未加载 WinUSB driver。我已经尝试了所有我能想到的方法,但仍然无法让 Windows 加载 driver。我什至在 re-try 时卸载设备并删除注册表中的 USB 标志,但无济于事。有没有人可以帮助我让它工作?
我不需要 WebUSB 功能或任何其他功能。这是 non-composite 设备。
这是我的 BOS 描述符(通过 USB 发送):
05 0F 21 00 01 1C 10 05 00 DF 60 DD D8 89
45 C7 4C 9C D2 65 9D 9E 64 8A 9F 00 00 03
06 B2 00 01 00
这是我的 BOS 描述符集:
0A 00 00 00 00 00 03 06 B2 00 08 00 01 00 ..............
00 00 A8 00 08 00 02 00 00 00 A0 00 14 00 ..............
03 00 57 49 4E 55 53 42 00 00 00 00 00 00 ..WINUSB......
00 00 00 00 84 00 04 00 07 00 2A 00 44 00 ..........*.D.
65 00 76 00 69 00 63 00 65 00 49 00 6E 00 e.v.i.c.e.I.n.
74 00 65 00 72 00 66 00 61 00 63 00 65 00 t.e.r.f.a.c.e.
47 00 55 00 49 00 44 00 73 00 00 00 50 00 G.U.I.D.s...P.
7B 00 46 00 37 00 32 00 46 00 45 00 30 00 {.F.7.2.F.E.0.
44 00 34 00 2D 00 43 00 42 00 43 00 42 00 D.4.-.C.B.C.B.
2D 00 34 00 30 00 37 00 44 00 2D 00 38 00 -.4.0.7.D.-.8.
38 00 31 00 34 00 2D 00 39 00 45 00 44 00 8.1.4.-.9.E.D.
36 00 37 00 33 00 44 00 30 00 44 00 44 00 6.7.3.D.0.D.D.
36 00 42 00 7D 00 00 00 00 00 6.B.}.....
布局为:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SConfigurationSubsetHeader sConfSubsetHeader;
SFunctionSubsetHeader sFuncSubsetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
我已遵循这些指南和文档:
- https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/automatic-installation-of-winusb#winusb-device-installation-by-using-the-in-box-winusbinf
- MS_OS_2_0_desc.docx
- https://thewindowsupdate.com/2018/10/12/how-to-install-winusb-sys-without-a-custom-inf/
- https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/winusb-installation#automatic-installation-of--winusb-without-an-inf-file
更新:
当您的 non-composite 设备只有一个配置时,您就不会使用任何子集 headers('Configuration subset header' 或 'Function subset header')。所以,在这种情况下正确的布局是:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
更新:如果您的 non-composite 设备只有一个配置,则您不会使用任何子集 headers('Configuration subset header' 和 'Function subset header' ).所以,在这种情况下正确的布局是:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
我正在努力让 Windows 为我的设备加载默认的 WinUSB driver。请注意,我正在寻找使用 BOS 描述符(而不是旧的 0xEE 字符串索引)的解决方案。
设备枚举,Windows 告诉我它正在安装设备,但未加载 WinUSB driver。我已经尝试了所有我能想到的方法,但仍然无法让 Windows 加载 driver。我什至在 re-try 时卸载设备并删除注册表中的 USB 标志,但无济于事。有没有人可以帮助我让它工作?
我不需要 WebUSB 功能或任何其他功能。这是 non-composite 设备。
这是我的 BOS 描述符(通过 USB 发送):
05 0F 21 00 01 1C 10 05 00 DF 60 DD D8 89
45 C7 4C 9C D2 65 9D 9E 64 8A 9F 00 00 03
06 B2 00 01 00
这是我的 BOS 描述符集:
0A 00 00 00 00 00 03 06 B2 00 08 00 01 00 ..............
00 00 A8 00 08 00 02 00 00 00 A0 00 14 00 ..............
03 00 57 49 4E 55 53 42 00 00 00 00 00 00 ..WINUSB......
00 00 00 00 84 00 04 00 07 00 2A 00 44 00 ..........*.D.
65 00 76 00 69 00 63 00 65 00 49 00 6E 00 e.v.i.c.e.I.n.
74 00 65 00 72 00 66 00 61 00 63 00 65 00 t.e.r.f.a.c.e.
47 00 55 00 49 00 44 00 73 00 00 00 50 00 G.U.I.D.s...P.
7B 00 46 00 37 00 32 00 46 00 45 00 30 00 {.F.7.2.F.E.0.
44 00 34 00 2D 00 43 00 42 00 43 00 42 00 D.4.-.C.B.C.B.
2D 00 34 00 30 00 37 00 44 00 2D 00 38 00 -.4.0.7.D.-.8.
38 00 31 00 34 00 2D 00 39 00 45 00 44 00 8.1.4.-.9.E.D.
36 00 37 00 33 00 44 00 30 00 44 00 44 00 6.7.3.D.0.D.D.
36 00 42 00 7D 00 00 00 00 00 6.B.}.....
布局为:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SConfigurationSubsetHeader sConfSubsetHeader;
SFunctionSubsetHeader sFuncSubsetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
我已遵循这些指南和文档:
- https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/automatic-installation-of-winusb#winusb-device-installation-by-using-the-in-box-winusbinf
- MS_OS_2_0_desc.docx
- https://thewindowsupdate.com/2018/10/12/how-to-install-winusb-sys-without-a-custom-inf/
- https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/winusb-installation#automatic-installation-of--winusb-without-an-inf-file
更新: 当您的 non-composite 设备只有一个配置时,您就不会使用任何子集 headers('Configuration subset header' 或 'Function subset header')。所以,在这种情况下正确的布局是:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;
更新:如果您的 non-composite 设备只有一个配置,则您不会使用任何子集 headers('Configuration subset header' 和 'Function subset header' ).所以,在这种情况下正确的布局是:
typedef struct _SMSOS20DescriptorSet
{
SDeviceDescSetHeader sDescriptorSetHeader;
SDeviceCompatibleIdDescriptor sCompIdDescriptor;
SDeviceRegDescDeviceInterfaceGUID sRegistryDescDevInterfaceGuid;
} SMSOS20DescriptorSet;