Because there might be entries in the registry that aren't yet in the local cache -because populated by another process- and also not physically present anymore but that we still want to keep for when the devices are plugged back again?
I'm not sure I am following this, but maybe I'm not understanding something. My understanding of the registry entries here, and I think the tests show this, is that they're essentially GUIDs that map to `VID/PID/index` for a particular device. One `guidInstance` (which comes from the registry) can represent a different device depending on which controllers are plugged in at the time `EnumDevices()` is called. There shouldn't be an issue with race conditions between processes, the registry access is locked behind a mutex. The only thing that should be done in the registry is, finding an entry for a `VID/PID/IDX` pairing. If one does not exist, it is created, and along with it a new `guidInstance` value to represent the pairing. If one already exists, the `GUID` value from the registry is used for `guidInstance`. I don't see how another process doing an enumeration would break this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10364#note_135680