Author: akhaldi
Date: Sun Feb 26 16:37:17 2017
New Revision: 73935
URL:
http://svn.reactos.org/svn/reactos?rev=73935&view=rev
Log:
[DINPUT_WINETEST] Sync with Wine Staging 2.2. CORE-12823
Modified:
trunk/rostests/winetests/dinput/joystick.c
Modified: trunk/rostests/winetests/dinput/joystick.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/dinput/joystick…
==============================================================================
--- trunk/rostests/winetests/dinput/joystick.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/dinput/joystick.c [iso-8859-1] Sun Feb 26 16:37:17 2017
@@ -744,6 +744,46 @@
ok(hr==DI_OK, "IDirectInputDevice_GetProperty() failed: %08x\n",
hr);
ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not updated:
%i\n", dip_gain_get.dwData);
+ /* Test SendForceFeedbackCommand
+ * DISFFC_STOPALL - Should stop effects only
+ * DISFFC_RESET - Should stop effects and unload them (NOT release them)
+ * Tests for game Odallus (bug 41623) */
+ hr =
IDirectInputDevice2_SendForceFeedbackCommand((IDirectInputDevice2A*)pJoystick, 0);
+ ok(hr==DIERR_INVALIDPARAM,
"IDirectInputDevice_SendForceFeedbackCommand() failed: %08x\n", hr);
+ hr =
IDirectInputDevice2_SendForceFeedbackCommand((IDirectInputDevice2A*)pJoystick, 0xFF);
+ ok(hr==DIERR_INVALIDPARAM,
"IDirectInputDevice_SendForceFeedbackCommand() failed: %08x\n", hr);
+
+ hr = IDirectInputEffect_Download(effect);
+ ok(hr==DI_OK,"IDirectInputEffect_Download() failed: %08x\n", hr);
+
+ /* Send STOPALL and prove that the effect can still be started */
+ hr =
IDirectInputDevice2_SendForceFeedbackCommand((IDirectInputDevice2A*)pJoystick,
DISFFC_STOPALL);
+ ok(hr==DI_OK, "IDirectInputDevice_SendForceFeedbackCommand() failed:
%08x\n", hr);
+ 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_Start(effect, 1, 0);
+ ok(hr==DI_OK,"IDirectInputEffect_Start() failed: %08x\n", hr);
+ hr = IDirectInputEffect_GetEffectGuid(effect, &guid);
+ ok(hr==DI_OK,"IDirectInputEffect_GetEffectGuid() failed: %08x\n",
hr);
+ ok(IsEqualGUID(&effect_data.guid, &guid), "Wrong guid
returned\n");
+
+ /* Send RESET and prove that we can still manipulate the effect, thus not
released */
+ hr =
IDirectInputDevice2_SendForceFeedbackCommand((IDirectInputDevice2A*)pJoystick,
DISFFC_RESET);
+ ok(hr==DI_OK, "IDirectInputDevice_SendForceFeedbackCommand() failed:
%08x\n", hr);
+ hr = IDirectInputEffect_GetEffectStatus(effect, &effect_status);
+ ok(hr==DIERR_NOTDOWNLOADED,"IDirectInputEffect_GetEffectStatus() failed:
%08x\n", hr);
+ hr = IDirectInputEffect_Download(effect);
+ ok(hr==DI_OK,"IDirectInputEffect_Download() failed: %08x\n", hr);
+ 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_Start(effect, 1, 0);
+ ok(hr==DI_OK,"IDirectInputEffect_Start() failed: %08x\n", hr);
+ hr = IDirectInputEffect_GetEffectGuid(effect, &guid);
+ ok(hr==DI_OK,"IDirectInputEffect_GetEffectGuid() failed: %08x\n",
hr);
+ ok(IsEqualGUID(&effect_data.guid, &guid), "Wrong guid
returned\n");
+
ref = IUnknown_Release(effect);
ok(ref == 0, "IDirectInputDevice_Release() reference count = %d\n",
ref);
}