From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dinput/tests/joystick8.c | 1 - dlls/windows.gaming.input/provider.c | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/dinput/tests/joystick8.c b/dlls/dinput/tests/joystick8.c index e381ad7b6f5..3201a3608d2 100644 --- a/dlls/dinput/tests/joystick8.c +++ b/dlls/dinput/tests/joystick8.c @@ -5174,7 +5174,6 @@ static void test_windows_gaming_input(void) ok( hr == S_OK, "get_Gamepads returned %#lx\n", hr ); hr = IVectorView_Gamepad_get_Size( gamepads_view, &size ); ok( hr == S_OK, "get_Size returned %#lx\n", hr ); - todo_wine /* but Wine currently intentionally does */ ok( size == 0, "got size %u\n", size ); IVectorView_Gamepad_Release( gamepads_view ); IGamepadStatics_Release( gamepad_statics ); diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 69737dbafbd..b1d6b1c6c81 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -170,16 +170,18 @@ static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); DIDEVICEINSTANCEW instance = {.dwSize = sizeof(DIDEVICEINSTANCEW)}; + const WCHAR *tmp; HRESULT hr;
TRACE( "iface %p, value %p.\n", iface, value );
if (FAILED(hr = IDirectInputDevice8_GetDeviceInfo( impl->dinput_device, &instance ))) return hr;
- switch (GET_DIDEVICE_TYPE( instance.dwDevType )) + if ((tmp = wcschr( impl->device_path + 8, '#' )) && !wcsnicmp( tmp - 6, L"&XI_", 4 )) + *value = WineGameControllerType_Gamepad; + else switch (GET_DIDEVICE_TYPE( instance.dwDevType )) { case DI8DEVTYPE_DRIVING: *value = WineGameControllerType_RacingWheel; break; - case DI8DEVTYPE_GAMEPAD: *value = WineGameControllerType_Gamepad; break; default: { DWORD count = 0;