Rémi Bernon : dinput: Return DIERR_NOTFOUND when DIPROP_RANGE object isn't found.

Alexandre Julliard julliard at winehq.org
Tue Sep 28 16:01:56 CDT 2021


Module: wine
Branch: master
Commit: 50c1f45441e7999513b9c851a97ed942816e3c79
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=50c1f45441e7999513b9c851a97ed942816e3c79

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Tue Sep 28 09:30:08 2021 +0200

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

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/joystick_hid.c | 7 ++++---
 dlls/dinput8/tests/hid.c   | 3 ---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index dfff379091e..73339564cd1 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -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;
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 25e7511353f..affdddd153f 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -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;




More information about the wine-cvs mailing list