From: Connor McAdams <cmcadams@codeweavers.com> Signed-off-by: Connor McAdams <cmcadams@codeweavers.com> --- dlls/dinput/joystick_hid.c | 4 ++++ dlls/dinput/tests/joystick8.c | 13 ++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 6feaa842047..bc87be39293 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -255,7 +255,11 @@ static HRESULT get_instance_from_guid( const GUID *guid, DIDEVICEINSTANCEW *inst LIST_FOR_EACH_ENTRY( entry, &joystick_cache, struct cache_entry, entry ) { + GUID guid_joystick = GUID_Joystick; + if (!*entry->path) continue; + guid_joystick.Data1 |= entry->joy_id; + if (entry->joy_id < 16 && IsEqualGUID( &guid_joystick, guid )) break; if (IsEqualGUID( &entry->instance.guidProduct, guid )) break; if (IsEqualGUID( &entry->instance.guidInstance, guid )) break; } diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index d52a53792d6..48a7e6ebc0d 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -6824,13 +6824,12 @@ static void test_joystick_id( DWORD version ) joystick_id_guid.Data1 += i; hr = dinput_create_device( &di, &joystick_id_guid, &device ); - todo_wine ok( hr == DI_OK, "Unexpected hr %#lx.\n", hr ); - if (device) - { - check_device_hid_serial( device, descs_bulk[i].serial_str ); - check_device_joystick_id( device, i, TRUE ); - IDirectInputDevice8_Release(device); - } + ok( hr == DI_OK, "Unexpected hr %#lx.\n", hr ); + + check_device_hid_serial( device, descs_bulk[i].serial_str ); + check_device_joystick_id( device, i, FALSE ); + + IDirectInputDevice8_Release(device); } winetest_pop_context(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10755