Commit 1832dc3d authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

dinput: Fix IDirectInputEffect::SetParameters() when called with flags=0.

parent 23a55927
......@@ -489,15 +489,11 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
TRACE("(this=%p,%p,%d)\n", This, peff, dwFlags);
if ((dwFlags & ~DIEP_NORESTART & ~DIEP_NODOWNLOAD & ~DIEP_START) == 0) {
/* set everything */
dwFlags = DIEP_AXES | DIEP_DIRECTION | DIEP_DURATION | DIEP_ENVELOPE |
DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERBUTTON |
DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS;
}
dump_DIEFFECT(peff, &This->guid, dwFlags);
if (!dwFlags)
return DI_NOEFFECT;
if (dwFlags & DIEP_AXES) {
if (!(peff->rgdwAxes))
return DIERR_INVALIDPARAM;
......
......@@ -1097,7 +1097,10 @@ static HRESULT WINAPI JoystickWImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface, RE
if (lpeff != NULL)
{
retval = IDirectInputEffect_SetParameters(new_effect->ref, lpeff, 0);
retval = IDirectInputEffect_SetParameters(new_effect->ref, lpeff,
DIEP_AXES | DIEP_DIRECTION | DIEP_DURATION | DIEP_ENVELOPE |
DIEP_GAIN | DIEP_SAMPLEPERIOD | DIEP_STARTDELAY | DIEP_TRIGGERBUTTON |
DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS);
if (retval != DI_OK && retval != DI_DOWNLOADSKIPPED)
{
......
......@@ -663,11 +663,9 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment