[PATCH v2] xactengine3_7: Return a valid HRESULT in IXACT3SoundBank Play

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Sep 18 02:55:28 CDT 2020


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 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




More information about the wine-devel mailing list