Bruno Jesus : dinput: Cope with NULL flags in LinuxInputEffectImpl_GetEffectStatus.
Module: wine Branch: master Commit: e8273ae497ff3c3e28674281127be17ddaacaffd URL: http://source.winehq.org/git/wine.git/?a=commit;h=e8273ae497ff3c3e2867428112... Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Aug 18 22:50:13 2016 -0300 dinput: Cope with NULL flags in LinuxInputEffectImpl_GetEffectStatus. Signed-off-by: Bruno Jesus <00cpxxx(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dinput/effect_linuxinput.c | 3 +++ dlls/dinput/tests/joystick.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index ad7d3ad..dc12aa6 100644 --- a/dlls/dinput/effect_linuxinput.c +++ b/dlls/dinput/effect_linuxinput.c @@ -131,6 +131,9 @@ static HRESULT WINAPI LinuxInputEffectImpl_GetEffectStatus( { TRACE("(this=%p,%p)\n", iface, pdwFlags); + if (!pdwFlags) + return E_POINTER; + /* linux sends the effect status through an event. * that event is trapped by our parent joystick driver * and there is no clean way to pass it back to us. */ diff --git a/dlls/dinput/tests/joystick.c b/dlls/dinput/tests/joystick.c index 77bb729..af36e6d 100644 --- a/dlls/dinput/tests/joystick.c +++ b/dlls/dinput/tests/joystick.c @@ -473,6 +473,9 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) * - effects are preserved (Download + Start doesn't complain * about incomplete effect) */ + hr = IDirectInputEffect_GetEffectStatus(effect, NULL); + ok(hr==E_POINTER,"IDirectInputEffect_GetEffectStatus() must fail with E_POINTER, got: %08x\n", hr); + effect_status = 0xdeadbeef; 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");
participants (1)
-
Alexandre Julliard