Re: Use same INF for multiple devices (same VID / PID)?

Peter Dons Tychsen via Libusb-win32-devel <[email protected]> Fri, 13 Apr 2018 01:14:49 +0200
Newsgroups gmane.comp.lib.libusb.devel.windows
Organization DonTech ApS
Message-ID <[email protected]>
Hi Rafael,

> Currently I seem to be able to install each device with the same INF
> file, but the driver is not remembered between devices, meaning every
> time I switch devices, I have to reinstall the INF file.

In Windows, there are 2 ways that USB devices are remembered:

1) Using the VID/PID if the serial number is _not_ present. In this
case you can swap between several identical devices (on the same port)
without having Windows prompt you for a new password. Device are also
remembered pr port, so Windows will query for a driver the first time
each port sees this VID/PID combination.

2) Using the serial number _if_ present (normally unique pr. device).
In this case Windows will query for a driver every time a new device is
seen. This is however remembered across ports, so moving the device
from port to port will not generate a query for a driver if it is the
same device.

You are likely stuck in scenario #2. For Vista and forward you can set
the registry key "IgnoreHWSerNum", which forces scenario #1 for that
particular device.

https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-de
vice-specific-registry-settings

You can set that key using a utility (small program in C/C#/whatever),
in your INF file, or in your USB device using "OS descriptors" (if you
have created the USB device).

https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/micros
oft-defined-usb-descriptors

You can modify the registry in INF like this:

https://docs.microsoft.com/en-us/windows-hardware/drivers/install/inf-f
ile-entry-values-that-modify-device-properties

Hope this helps.

Thanks,

/pedro

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot