On Mon Dec 8 18:13:00 2025 +0000, Connor McAdams wrote:
Question here: have you considered using `busnum` instead of `devpath`? It seems like `busnum` would be easier to parse/use, but is there potential for both `busnum`/`devnum` to match between two separate USB devices? Busnum just identifies a root hub in the system. So IMO it is not suitable by itself for identifying a USB device.
I'm using both busnum/devpath, as they don't depend on load order (or hotplug, etc.), and are unique. As long as the device remains connected/hotplugged to the same port, it will always have the same busnum/devpath. I think MS also uses these parameters, when there is no SN available. On the other hand devnum depends on the load order and increases with each hotplug. So the busnum/devnum pair can only be unique within a single system session (from boot to shutdown), but there is no guarantee that it'll be the same for the given device at the next boot. IMO we need device ids (instance_id, container_id, guidInstance, etc.) that do not change at every system boot or Wine launch, since games/apps usually store them for reference in their app configurations. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9687#note_125247