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>
This commit is contained in:
Rémi Bernon 2021-09-28 09:30:09 +02:00 committed by Alexandre Julliard
parent 50c1f45441
commit 5d1f3baacd
2 changed files with 1 additions and 2 deletions

View File

@ -533,6 +533,7 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con
{ {
case (DWORD_PTR)DIPROP_RANGE: case (DWORD_PTR)DIPROP_RANGE:
if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM; 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) if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP)
return DI_OK; return DI_OK;
return DIERR_NOTFOUND; return DIERR_NOTFOUND;

View File

@ -3879,7 +3879,6 @@ static void test_simple_joystick(void)
todo_wine todo_wine
ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_SATURATION returned %#x\n", hr );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_dword.diph.dwHow = DIPH_BYUSAGE; prop_dword.diph.dwHow = DIPH_BYUSAGE;
@ -4288,7 +4287,6 @@ static void test_simple_joystick(void)
prop_range.lMin = 0xdeadbeef; prop_range.lMin = 0xdeadbeef;
prop_range.lMax = 0xdeadbeef; prop_range.lMax = 0xdeadbeef;
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph ); hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr ); ok( hr == DIERR_UNSUPPORTED, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwHow = DIPH_BYUSAGE; prop_range.diph.dwHow = DIPH_BYUSAGE;
prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC ); prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );