adafruit / Adafruit_Windows_Drivers

All in one Windows driver installer for Adafruit's boards.
MIT License
86 stars 28 forks source link

Try using a class driver designation for CDC instead of MI=00 #34

Closed dhalbert closed 2 years ago

dhalbert commented 2 years ago

Windows 10 installs usbser.sys using a class driver designation: https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-driver-installation-based-on-compatible-ids#windows10 :

USB\Class_02&SubClass_02

If I can do this in Windows 7 and imitate the Windows 10 behavior, then that will actually considerably simplify the Windows 7/8.x drivers .inf file, and I will stop needing to update it for each new board.

Another motivation for this is to allow other devices to live at interface 0. In particular we need this for boot keyboards: https://github.com/hathach/tinyusb/issues/1129 and https://github.com/adafruit/circuitpython/issues/1136

dhalbert commented 2 years ago

I tried a device id line like:

"USB Serial"=DriverInstall, USB\Class_02&SubClass_02

This does not work because a third-party driver cannot be a class driver: it cannot recognize a device solely by its class (its "Compatible ID"). The .cat file creator complains and throws an error on the above. Instead, a device must be recognized by its complete hardware ID, e.g. USB\VID_0239a&PID_1234. It's not possible to wildcard the PID either.

Third-party drivers can't be class drivers as a matter of policy. It's kind of a security issue.

A good explanation is here: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c5fd913c-f058-48c2-9b1e-7cc37b75a635/using-only-compatible-ids-in-a-driver-inf-file?forum=wdk