Brendan Shanks : dinput/tests: Test IDirectInputEffect::SetParameters() with a zeroed DIEFFECT and flags=0.

Alexandre Julliard julliard at winehq.org
Fri Apr 24 15:11:39 CDT 2020


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

Author: Brendan Shanks <bshanks at codeweavers.com>
Date:   Thu Apr 23 22:40:16 2020 -0700

dinput/tests: Test IDirectInputEffect::SetParameters() with a zeroed DIEFFECT and flags=0.

Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/tests/joystick.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c
index a3d7440367..810707c02a 100644
--- a/dlls/dinput/tests/joystick.c
+++ b/dlls/dinput/tests/joystick.c
@@ -600,6 +600,7 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
             struct DIPROPDWORD diprop_word;
             void *tmp;
             GUID guid = {0};
+            DIEFFECT effect_empty;
 
             hr = IDirectInputEffect_Initialize(effect, hInstance, data->version,
                                                &effect_data.guid);
@@ -658,7 +659,15 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
             hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
             ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);
             ok(effect_status==0,"IDirectInputEffect_GetEffectStatus() reported effect as started\n");
-            hr = IDirectInputEffect_SetParameters(effect, &effect_data.eff, DIEP_START);
+            /* SetParameters with a zeroed-out DIEFFECT and flags=0 should do nothing. */
+            memset(&effect_empty, 0, sizeof(effect_empty));
+            effect_empty.dwSize = sizeof(effect_empty);
+            hr = IDirectInputEffect_SetParameters(effect, &effect_empty, 0);
+            todo_wine
+            ok(hr==DI_NOEFFECT,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
+            /* Start effect with SetParameters and a zeroed-out DIEFFECT. */
+            hr = IDirectInputEffect_SetParameters(effect, &effect_empty, DIEP_START);
+            todo_wine
             ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
             hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
             ok(hr==DI_OK,"IDirectInputEffect_GetEffectStatus() failed: %08x\n", hr);




More information about the wine-cvs mailing list