Module: wine Branch: master Commit: 5d1f3baacd2aa78b77c26240f78406d192be4cf9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=5d1f3baacd2aa78b77c26240f...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Sep 28 09:30:09 2021 +0200
dinput: Return DIERR_UNSUPPORTED when reading DIPROP_RANGE with DIPH_DEVICE mode.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dinput/joystick_hid.c | 1 + dlls/dinput8/tests/hid.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 73339564cd1..b4ccbd9f509 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -533,6 +533,7 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con { case (DWORD_PTR)DIPROP_RANGE: if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; + if (header->dwHow == DIPH_DEVICE) return DIERR_UNSUPPORTED; if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP) return DI_OK; return DIERR_NOTFOUND; diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c index affdddd153f..41f6d5316b5 100644 --- a/dlls/dinput8/tests/hid.c +++ b/dlls/dinput8/tests/hid.c @@ -3879,7 +3879,6 @@ static void test_simple_joystick(void) todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; @@ -4288,7 +4287,6 @@ static void test_simple_joystick(void) prop_range.lMin = 0xdeadbeef; prop_range.lMax = 0xdeadbeef; hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); - todo_wine ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );