Rémi Bernon : dinput: Fix DIPROP_FFGAIN mouse and keyboard tests.

Alexandre Julliard julliard at winehq.org
Fri Jun 10 16:28:26 CDT 2022


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Jun  2 15:44:04 2022 +0200

dinput: Fix DIPROP_FFGAIN mouse and keyboard tests.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>

---

 dlls/dinput/device.c        |  2 +-
 dlls/dinput/tests/device8.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
index 9e7cb20453c..f4bdce51633 100644
--- a/dlls/dinput/device.c
+++ b/dlls/dinput/device.c
@@ -1394,9 +1394,9 @@ static HRESULT WINAPI dinput_device_set_property( IDirectInputDevice8W *iface, c
     case (DWORD_PTR)DIPROP_FFGAIN:
     {
         const DIPROPDWORD *value = (const DIPROPDWORD *)header;
-        if (!impl->vtbl->send_device_gain) return DIERR_UNSUPPORTED;
         impl->device_gain = value->dwData;
         if (!is_exclusively_acquired( impl )) return DI_OK;
+        if (!impl->vtbl->send_device_gain) return DI_OK;
         return impl->vtbl->send_device_gain( iface, impl->device_gain );
     }
     case (DWORD_PTR)DIPROP_AXISMODE:
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c
index 7bd3600df61..a5c647713f2 100644
--- a/dlls/dinput/tests/device8.c
+++ b/dlls/dinput/tests/device8.c
@@ -1745,14 +1745,14 @@ static void test_mouse_info(void)
     hr = IDirectInputDevice8_GetProperty( device, DIPROP_KEYNAME, &prop_string.diph );
     ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_KEYNAME returned %#lx\n", hr );
 
-    prop_range.diph.dwHow = DIPH_DEVICE;
-    prop_range.diph.dwObj = 0;
+    prop_dword.diph.dwHow = DIPH_DEVICE;
+    prop_dword.diph.dwObj = 0;
     prop_dword.dwData = 0xdeadbeef;
     hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
-    ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
+    ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
     prop_dword.dwData = 1000;
     hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
-    ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
+    ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
 
     res = 0;
     hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON );
@@ -2080,14 +2080,14 @@ static void test_keyboard_info(void)
     hr = IDirectInputDevice8_GetProperty( device, DIPROP_RANGE, &prop_range.diph );
     ok( hr == DIERR_UNSUPPORTED, "GetProperty DIPROP_RANGE returned %#lx\n", hr );
 
-    prop_range.diph.dwHow = DIPH_DEVICE;
-    prop_range.diph.dwObj = 0;
+    prop_dword.diph.dwHow = DIPH_DEVICE;
+    prop_dword.diph.dwObj = 0;
     prop_dword.dwData = 0xdeadbeef;
     hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
-    ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
+    ok( hr == DIERR_INVALIDPARAM, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
     prop_dword.dwData = 1000;
     hr = IDirectInputDevice8_SetProperty( device, DIPROP_FFGAIN, &prop_dword.diph );
-    ok( hr == DIERR_UNSUPPORTED, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
+    ok( hr == DI_OK, "SetProperty DIPROP_FFGAIN returned %#lx\n", hr );
 
     res = 0;
     hr = IDirectInputDevice8_EnumObjects( device, check_object_count, &res, DIDFT_AXIS | DIDFT_PSHBUTTON );




More information about the wine-cvs mailing list