Alistair Leslie-Hughes : xactengine3_7: Map IXACT3Cue interfaces.
Alexandre Julliard
julliard at winehq.org
Thu Aug 4 14:46:39 CDT 2022
Module: wine
Branch: master
Commit: 8b65074dae203b367fdeb4f60258c7fb470a702e
URL: https://gitlab.winehq.org/wine/wine/-/commit/8b65074dae203b367fdeb4f60258c7fb470a702e
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu Jul 21 08:04:13 2022 +1000
xactengine3_7: Map IXACT3Cue interfaces.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/xactengine3_7/xact_dll.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 5dc857513f8..eff0c8e5c4b 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -144,6 +144,7 @@ static HRESULT wrapper_add_entry(XACT3EngineImpl *engine, void *fact, void *xact
typedef struct _XACT3CueImpl {
IXACT3Cue IXACT3Cue_iface;
FACTCue *fact_cue;
+ XACT3EngineImpl *engine;
} XACT3CueImpl;
static inline XACT3CueImpl *impl_from_IXACT3Cue(IXACT3Cue *iface)
@@ -188,6 +189,7 @@ static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface)
ret = FACTCue_Destroy(This->fact_cue);
if (ret != 0)
WARN("FACTCue_Destroy returned %d\n", ret);
+ wrapper_remove_entry(This->engine, This->fact_cue);
HeapFree(GetProcessHeap(), 0, This);
return S_OK;
}
@@ -395,6 +397,7 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface,
XACT3CueImpl *cue;
FACTCue *fcue;
UINT ret;
+ HRESULT hr;
TRACE("(%p)->(%u, 0x%lx, %lu, %p)\n", This, nCueIndex, dwFlags, timeOffset,
ppCue);
@@ -415,8 +418,17 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface,
return E_OUTOFMEMORY;
}
+ hr = wrapper_add_entry(This->engine, fcue, &cue->IXACT3Cue_iface);
+ if (FAILED(hr))
+ {
+ FACTCue_Destroy(fcue);
+ HeapFree(GetProcessHeap(), 0, cue);
+ return hr;
+ }
+
cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl;
cue->fact_cue = fcue;
+ cue->engine = This->engine;
*ppCue = &cue->IXACT3Cue_iface;
TRACE("Created Cue: %p\n", cue);
@@ -457,8 +469,17 @@ static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface,
return E_OUTOFMEMORY;
}
+ hr = wrapper_add_entry(This->engine, fcue, &cue->IXACT3Cue_iface);
+ if (FAILED(hr))
+ {
+ FACTCue_Destroy(fcue);
+ HeapFree(GetProcessHeap(), 0, cue);
+ return hr;
+ }
+
cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl;
cue->fact_cue = fcue;
+ cue->engine = This->engine;
*ppCue = &cue->IXACT3Cue_iface;
}
More information about the wine-cvs
mailing list