dinput: Return DI_DOWNLOADSKIPPED from SetParameters.

When Download or Start failed because device is not acquired.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51922
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ivo Ivanov 2021-11-15 11:14:06 +01:00 committed by Alexandre Julliard
parent 979b19ce73
commit ee8015b97a
2 changed files with 4 additions and 4 deletions

View File

@ -2406,9 +2406,10 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
impl->flags |= flags;
if (flags & DIEP_NODOWNLOAD) return DI_DOWNLOADSKIPPED;
if (flags & DIEP_START) return IDirectInputEffect_Start( iface, 1, 0 );
if (FAILED(hr = IDirectInputEffect_Download( iface ))) return hr;
if (hr == DI_NOEFFECT) return DI_DOWNLOADSKIPPED;
if (flags & DIEP_START) hr = IDirectInputEffect_Start( iface, 1, 0 );
else hr = IDirectInputEffect_Download( iface );
if (hr == DIERR_NOTEXCLUSIVEACQUIRED) return DI_DOWNLOADSKIPPED;
if (FAILED(hr)) return hr;
return DI_OK;
}

View File

@ -5697,7 +5697,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
ok( hr == DI_OK, "Unacquire returned: %#x\n", hr );
set_hid_expect( file, NULL, 0 );
hr = IDirectInputEffect_SetParameters( effect, &expect_desc, DIEP_DURATION );
todo_wine
ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
set_hid_expect( file, &expect_dc_reset, sizeof(expect_dc_reset) );
hr = IDirectInputDevice8_Acquire( device );