diff --git a/dlls/windows.gaming.input/provider.c b/dlls/windows.gaming.input/provider.c index 39229a35c7d..6908d733a53 100644 --- a/dlls/windows.gaming.input/provider.c +++ b/dlls/windows.gaming.input/provider.c @@ -141,6 +141,13 @@ static HRESULT WINAPI wine_provider_GetTrustLevel( IWineGameControllerProvider * return E_NOTIMPL; } +static BOOL CALLBACK count_ffb_axes( const DIDEVICEOBJECTINSTANCEW *obj, void *args ) +{ + DWORD *count = args; + if (obj->dwType & DIDFT_FFACTUATOR) (*count)++; + return DIENUM_CONTINUE; +} + static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface, WineGameControllerType *value ) { struct provider *impl = impl_from_IWineGameControllerProvider( iface ); @@ -155,7 +162,14 @@ static HRESULT WINAPI wine_provider_get_Type( IWineGameControllerProvider *iface { case DI8DEVTYPE_DRIVING: *value = WineGameControllerType_RacingWheel; break; case DI8DEVTYPE_GAMEPAD: *value = WineGameControllerType_Gamepad; break; - default: *value = WineGameControllerType_Joystick; break; + default: + { + DWORD count = 0; + hr = IDirectInputDevice8_EnumObjects( impl->dinput_device, count_ffb_axes, &count, DIDFT_AXIS ); + if (SUCCEEDED(hr) && count == 1) *value = WineGameControllerType_RacingWheel; + else *value = WineGameControllerType_Joystick; + break; + } } return S_OK;