Commit f6deca59 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmsynth: Return S_FALSE if IDirectMusicSynth_Activate is no-op.

parent 722262b0
......@@ -422,16 +422,11 @@ static HRESULT WINAPI synth_Activate(IDirectMusicSynth8 *iface, BOOL enable)
TRACE("(%p)->(%d)\n", This, enable);
if (enable == This->active) return S_FALSE;
if (!This->sink)
return DMUS_E_NOSYNTHSINK;
if (enable == This->active) {
if (enable)
return DMUS_E_SYNTHACTIVE;
else
return S_FALSE;
}
if ((hr = IDirectMusicSynthSink_Activate(This->sink, enable)) != S_OK) {
if (hr == DMUS_E_SYNTHACTIVE || hr == S_FALSE)
WARN("Synth and sink active state out of sync. Fixing.\n");
......
......@@ -1007,7 +1007,7 @@ static void test_IDirectMusicSynth(void)
hr = IDirectMusicSynth_Activate(synth, TRUE);
ok(hr == DMUS_E_NOSYNTHSINK, "got %#lx\n", hr);
hr = IDirectMusicSynth_Activate(synth, FALSE);
todo_wine ok(hr == S_FALSE, "got %#lx\n", hr);
ok(hr == S_FALSE, "got %#lx\n", hr);
hr = IDirectMusicSynth_SetSynthSink(synth, NULL);
ok(hr == S_OK, "got %#lx\n", hr);
......@@ -1034,7 +1034,7 @@ static void test_IDirectMusicSynth(void)
hr = IDirectMusicSynth_Activate(synth, TRUE);
todo_wine ok(hr == S_OK, "got %#lx\n", hr);
hr = IDirectMusicSynth_Activate(synth, TRUE);
todo_wine ok(hr == S_FALSE, "got %#lx\n", hr);
ok(hr == S_FALSE, "got %#lx\n", hr);
/* Close is fine while active */
hr = IDirectMusicSynth_Close(synth);
......
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