Alistair Leslie-Hughes : xactengine3_7: Map IXACT3Wave interfaces.

Alexandre Julliard julliard at winehq.org
Thu Aug 4 14:46:39 CDT 2022


Module: wine
Branch: master
Commit: 6a7c02ac6ab9836059ad6243fd95b9d0916e69d9
URL:    https://gitlab.winehq.org/wine/wine/-/commit/6a7c02ac6ab9836059ad6243fd95b9d0916e69d9

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Jul 22 08:50:57 2022 +1000

xactengine3_7: Map IXACT3Wave interfaces.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>

---

 dlls/xactengine3_7/xact_dll.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index eff0c8e5c4b..13a6133bb95 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -540,6 +540,7 @@ typedef struct _XACT3WaveImpl {
     IXACT3Wave IXACT3Wave_iface;
 
     FACTWave *fact_wave;
+    XACT3EngineImpl *engine;
 } XACT3WaveImpl;
 
 static inline XACT3WaveImpl *impl_from_IXACT3Wave(IXACT3Wave *iface)
@@ -555,6 +556,7 @@ static HRESULT WINAPI IXACT3WaveImpl_Destroy(IXACT3Wave *iface)
     TRACE("(%p)\n", This);
 
     hr = FACTWave_Destroy(This->fact_wave);
+    wrapper_remove_entry(This->engine, This->fact_wave);
     HeapFree(GetProcessHeap(), 0, This);
     return hr;
 }
@@ -720,6 +722,7 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface,
     XACT3WaveImpl *wave;
     FACTWave *fwave;
     UINT ret;
+    HRESULT hr;
 
     TRACE("(%p)->(0x%x, %lu, 0x%lx, %u, %p)\n", This, nWaveIndex, dwFlags,
             dwPlayOffset, nLoopCount, ppWave);
@@ -740,8 +743,17 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface,
         return E_OUTOFMEMORY;
     }
 
+    hr = wrapper_add_entry(This->engine, fwave, &wave->IXACT3Wave_iface);
+    if (FAILED(hr))
+    {
+        FACTWave_Destroy(fwave);
+        HeapFree(GetProcessHeap(), 0, wave);
+        return hr;
+    }
+
     wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl;
     wave->fact_wave = fwave;
+    wave->engine = This->engine;
     *ppWave = &wave->IXACT3Wave_iface;
 
     TRACE("Created Wave: %p\n", wave);
@@ -782,8 +794,17 @@ static HRESULT WINAPI IXACT3WaveBankImpl_Play(IXACT3WaveBank *iface,
             return E_OUTOFMEMORY;
         }
 
+        hr = wrapper_add_entry(This->engine, fwave, &wave->IXACT3Wave_iface);
+        if (FAILED(hr))
+        {
+            FACTWave_Destroy(fwave);
+            HeapFree(GetProcessHeap(), 0, wave);
+            return hr;
+        }
+
         wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl;
         wave->fact_wave = fwave;
+        wave->engine = This->engine;
         *ppWave = &wave->IXACT3Wave_iface;
     }
 
@@ -1288,6 +1309,7 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface,
     XACT3WaveImpl *wave;
     FACTWave *fwave = NULL;
     UINT ret;
+    HRESULT hr;
 
     TRACE("(%p)->(0x%08lx, %s, %d, %ld, %ld, %d, %p)\n", This, dwFlags, debugstr_a(szWavePath),
           wStreamingPacketSize, dwAlignment, dwPlayOffset, nLoopCount, ppWave);
@@ -1307,8 +1329,17 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface,
         return E_OUTOFMEMORY;
     }
 
+    hr = wrapper_add_entry(This, fwave, &wave->IXACT3Wave_iface);
+    if (FAILED(hr))
+    {
+        FACTWave_Destroy(fwave);
+        HeapFree(GetProcessHeap(), 0, wave);
+        return hr;
+    }
+
     wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl;
     wave->fact_wave = fwave;
+    wave->engine = This;
     *ppWave = &wave->IXACT3Wave_iface;
 
     TRACE("Created Wave: %p\n", wave);




More information about the wine-cvs mailing list