Module: wine Branch: master Commit: f6deca5932d5bc7d0449f508a99f0b413b697944 URL: https://gitlab.winehq.org/wine/wine/-/commit/f6deca5932d5bc7d0449f508a99f0b4...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Aug 29 14:28:50 2023 +0200
dmsynth: Return S_FALSE if IDirectMusicSynth_Activate is no-op.
---
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 423efb38e83..6d1124068b2 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);