Rémi Bernon : dinput: Allow DIEFF_CARTESIAN directions when cAxes matches.

Alexandre Julliard julliard at winehq.org
Wed Nov 10 15:34:48 CST 2021


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

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Nov 10 10:52:25 2021 +0100

dinput: Allow DIEFF_CARTESIAN directions when cAxes matches.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/joystick_hid.c | 2 +-
 dlls/dinput8/tests/hid.c   | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index dfaf6ae83ff..dd77f557e3e 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -2224,7 +2224,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
         count = impl->params.cAxes;
         if (params->cAxes < count) return DIERR_INVALIDPARAM;
         if ((direction_flags & DIEFF_POLAR) && count != 2) return DIERR_INVALIDPARAM;
-        if ((direction_flags & DIEFF_CARTESIAN) && count < 2) return DIERR_INVALIDPARAM;
+        if ((direction_flags & DIEFF_CARTESIAN) && params->cAxes != count) return DIERR_INVALIDPARAM;
 
         if (!count) memset( directions, 0, sizeof(directions) );
         else if (direction_flags & DIEFF_POLAR)
diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index 4c1d73112cd..54109593a18 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -6061,11 +6061,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
         desc.rglDirection[1] = 2000;
         desc.rglDirection[2] = 3000;
         hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD );
-        todo_wine_if( i == 2 )
         ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr );
         desc.cAxes = i;
         hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD );
-        todo_wine_if( i == 1 )
         ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
 
         desc.dwFlags = DIEFF_SPHERICAL;




More information about the wine-cvs mailing list