From: Alistair Leslie-Hughes Subject: [PATCH v2] xactengine3_7: Return a valid HRESULT in IXACT3SoundBank Play Message-Id: Date: Fri, 18 Sep 2020 17:55:28 +1000 In-Reply-To: <20200918075528.797554-1-leslie_alistair@hotmail.com> References: <20200918075528.797554-1-leslie_alistair@hotmail.com> Signed-off-by: Alistair Leslie-Hughes --- dlls/xactengine3_7/xact_dll.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c index 742fe86cc9..aa16f062f5 100644 --- a/dlls/xactengine3_7/xact_dll.c +++ b/dlls/xactengine3_7/xact_dll.c @@ -273,7 +273,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); XACT3CueImpl *cue; FACTCue *fcue; - HRESULT hr; + UINT ret; TRACE("(%p)->(%u, 0x%x, %u, %p)\n", This, nCueIndex, dwFlags, timeOffset, ppCue); @@ -283,13 +283,13 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, * -flibit */ if (ppCue == NULL){ - hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, + ret = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, timeOffset, NULL); }else{ - hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, + ret = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, timeOffset, &fcue); - if(FAILED(hr)) - return hr; + if(ret != 0) + goto done; cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); if (!cue) @@ -304,7 +304,11 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, *ppCue = (IXACT3Cue*)&cue->IXACT3Cue_iface; } - return hr; +done: + if(ret != 0) + WARN("FACTSoundBank_Play returned %d\n", ret); + + return !ret ? S_OK : E_FAIL; } static HRESULT WINAPI IXACT3SoundBankImpl_Stop(IXACT3SoundBank *iface, -- 2.28.0