From: Rémi Bernon rbernon@codeweavers.com
--- dlls/dmsynth/synth.c | 9 ++------- dlls/dmsynth/tests/dmsynth.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 983e1502fe9..5c492c0e1cf 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -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"); diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c index 74c3bcea53b..f6ecf0a2d38 100644 --- a/dlls/dmsynth/tests/dmsynth.c +++ b/dlls/dmsynth/tests/dmsynth.c @@ -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);