On Tue Mar 24 11:55:21 2026 +0000, Rémi Bernon wrote:
I'm not convinced that it is like that. From your branch, I believe this patch: [dinput-processes.patch](/uploads/6daf552644835699012fbf57f7dcdf4b/dinput-processes.patch) shows that every process has the same view of enumerated devices as soon as they have been enumerated once. The `test_joystick_order_process` function (executed from `run_in_process( "test_joystick_order" )`) clears the system-wide registry, plugs devices in some order, enumerates them, then unplug the devices and plugs them back in reverse order, then enumerates them again. It shows that from a given process, the device enumeration is stable wrt plugging order as soon as devices have been enumerated. The patch adds extra checks, in `test_joystick_order_check_process` (executed from `run_in_process( "test_joystick_order_check" )`) with dinput device enumeration only (no registry reset or device changes) done in a separate process, each time the process enumerates its devices, and it shows that from a separate process, the order is the same as from the parent process, indicating that the device enumeration is also stable system-wide and not only per-process. Thanks for taking the time to look into this :)
From testing/modifying your tests, it looks like the device instance strings change between calls to `bus_device_stop()` and `bus_device_start()`. So, in my previous tests I was seeing the behavior for new device instances being created each time. I'll work on implementing this in the way you describe and find or add a way to determine the time that a device was first encountered. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10364#note_133541