dinput: On Unacquire, stop all effects and unload them.
This commit is contained in:
parent
a0c10c2af2
commit
41be1096c0
|
@ -678,6 +678,18 @@ static HRESULT WINAPI JoystickAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
|
||||||
TRACE("(this=%p)\n",This);
|
TRACE("(this=%p)\n",This);
|
||||||
res = IDirectInputDevice2AImpl_Unacquire(iface);
|
res = IDirectInputDevice2AImpl_Unacquire(iface);
|
||||||
if (res==DI_OK && This->joyfd!=-1) {
|
if (res==DI_OK && This->joyfd!=-1) {
|
||||||
|
effect_list_item *itr;
|
||||||
|
|
||||||
|
/* For each known effect:
|
||||||
|
* - stop it
|
||||||
|
* - unload it
|
||||||
|
* But, unlike DISFFC_RESET, do not release the effect.
|
||||||
|
*/
|
||||||
|
LIST_FOR_EACH_ENTRY(itr, &This->ff_effects, effect_list_item, entry) {
|
||||||
|
IDirectInputEffect_Stop(itr->ref);
|
||||||
|
IDirectInputEffect_Unload(itr->ref);
|
||||||
|
}
|
||||||
|
|
||||||
close(This->joyfd);
|
close(This->joyfd);
|
||||||
This->joyfd = -1;
|
This->joyfd = -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,7 +387,7 @@ static BOOL CALLBACK EnumJoysticks(
|
||||||
hr = IDirectInputDevice_Acquire(pJoystick);
|
hr = IDirectInputDevice_Acquire(pJoystick);
|
||||||
ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %08x\n", hr);
|
ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %08x\n", hr);
|
||||||
hr = IDirectInputEffect_SetParameters(effect, &eff, DIEP_GAIN);
|
hr = IDirectInputEffect_SetParameters(effect, &eff, DIEP_GAIN);
|
||||||
todo_wine ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
|
ok(hr==DI_OK,"IDirectInputEffect_SetParameters failed: %08x\n", hr);
|
||||||
}
|
}
|
||||||
ref = IUnknown_Release(effect);
|
ref = IUnknown_Release(effect);
|
||||||
ok(ref == 0, "IDirectInputDevice_Release() reference count = %d\n", ref);
|
ok(ref == 0, "IDirectInputDevice_Release() reference count = %d\n", ref);
|
||||||
|
|
Loading…
Reference in New Issue