Commit 50c1f454 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Return DIERR_NOTFOUND when DIPROP_RANGE object isn't found.

parent 5f6edba5
......@@ -515,7 +515,7 @@ static BOOL get_property_prop_range( struct hid_joystick *impl, struct hid_caps
DIPROPRANGE *value = data;
value->lMin = value_caps->PhysicalMin;
value->lMax = value_caps->PhysicalMax;
return DIENUM_CONTINUE;
return DIENUM_STOP;
}
static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, const GUID *guid,
......@@ -533,8 +533,9 @@ static HRESULT WINAPI hid_joystick_GetProperty( IDirectInputDevice8W *iface, con
{
case (DWORD_PTR)DIPROP_RANGE:
if (header->dwSize != sizeof(DIPROPRANGE)) return DIERR_INVALIDPARAM;
enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header );
return DI_OK;
if (enum_objects( impl, header, DIDFT_AXIS, get_property_prop_range, header ) == DIENUM_STOP)
return DI_OK;
return DIERR_NOTFOUND;
case (DWORD_PTR)DIPROP_PRODUCTNAME:
{
DIPROPSTRING *value = (DIPROPSTRING *)header;
......
......@@ -3908,15 +3908,12 @@ 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_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( 0, HID_USAGE_PAGE_GENERIC );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_X );
hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
todo_wine
ok( hr == DIERR_NOTFOUND, "IDirectInputDevice8_GetProperty DIPROP_RANGE returned %#x\n", hr );
prop_range.diph.dwObj = MAKELONG( HID_USAGE_GENERIC_X, HID_USAGE_PAGE_GENERIC );
prop_range.lMin = 0xdeadbeef;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment