Rémi Bernon (@rbernon) commented about dlls/dinput/joystick_hid.c:
+ tmp.Data1 &= 0xfffffff0; + is_guid_joystick = IsEqualGUID( &tmp, &GUID_Joystick); + EnterCriticalSection( &joystick_cache_cs );
LIST_FOR_EACH_ENTRY( entry, &joystick_cache, struct cache_entry, entry ) { if (!*entry->path) continue; + if (is_guid_joystick) + { + if (entry->joy_id == (guid->Data1 & 0xf)) break; + continue; + } if (IsEqualGUID( &entry->instance.guidProduct, guid )) break; if (IsEqualGUID( &entry->instance.guidInstance, guid )) break;
Instead of an integer joy_id, we could keep a full GUID guid_joystick, and compare it like the other here. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10755#note_137762