From 3f3a05f91c85cb5ccdc4c8185bcc862c6e96cd52 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sat, 4 Jul 2020 11:38:00 -0500 Subject: [PATCH] xactengine-initial: Get rid of the separate IXACT34Cue implementation. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49514 --- ...-xaudio2-Add-support-for-xactengine3.patch | 202 +++--------------- ...ys-return-S_OK-in-IXACT34Cue-Destroy.patch | 34 +-- 2 files changed, 47 insertions(+), 189 deletions(-) diff --git a/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch b/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch index 6ffd3f48..38271cbb 100644 --- a/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch +++ b/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch @@ -1,4 +1,4 @@ -From 4ed706183e0d82b3d60ccba9564d4b05d2441049 Mon Sep 17 00:00:00 2001 +From 97cb314d440fa08f08054b02c1c5a2d8d482597f Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 13 Nov 2019 12:13:45 -0500 Subject: [PATCH] xaudio2: Add support for xactengine3 @@ -30,8 +30,8 @@ Signed-off-by: Ethan Lee dlls/xactengine3_7/xactengine3_7.spec | 4 + dlls/xaudio2_7/Makefile.in | 5 +- dlls/xaudio2_7/xact_classes.idl | 93 ++ - dlls/xaudio2_7/xact_dll.c | 1387 +++++++++++++++++++++++++ - 20 files changed, 1628 insertions(+), 1 deletion(-) + dlls/xaudio2_7/xact_dll.c | 1239 +++++++++++++++++++++++++ + 20 files changed, 1480 insertions(+), 1 deletion(-) create mode 100644 dlls/xactengine3_0/Makefile.in create mode 100644 dlls/xactengine3_0/xactengine3_0.spec create mode 100644 dlls/xactengine3_1/Makefile.in @@ -52,10 +52,10 @@ Signed-off-by: Ethan Lee create mode 100644 dlls/xaudio2_7/xact_dll.c diff --git a/configure.ac b/configure.ac -index 47d2b750c0..1feca3c8e0 100644 +index d5964223204..10e804090e2 100644 --- a/configure.ac +++ b/configure.ac -@@ -1917,6 +1917,14 @@ then +@@ -1961,6 +1961,14 @@ then enable_x3daudio1_5=${enable_x3daudio1_5:-no} enable_x3daudio1_6=${enable_x3daudio1_6:-no} enable_x3daudio1_7=${enable_x3daudio1_7:-no} @@ -70,7 +70,7 @@ index 47d2b750c0..1feca3c8e0 100644 enable_xapofx1_1=${enable_xapofx1_1:-no} enable_xapofx1_2=${enable_xapofx1_2:-no} enable_xapofx1_3=${enable_xapofx1_3:-no} -@@ -3845,6 +3853,14 @@ WINE_CONFIG_MAKEFILE(dlls/x3daudio1_4) +@@ -3896,6 +3904,14 @@ WINE_CONFIG_MAKEFILE(dlls/x3daudio1_4) WINE_CONFIG_MAKEFILE(dlls/x3daudio1_5) WINE_CONFIG_MAKEFILE(dlls/x3daudio1_6) WINE_CONFIG_MAKEFILE(dlls/x3daudio1_7) @@ -87,7 +87,7 @@ index 47d2b750c0..1feca3c8e0 100644 WINE_CONFIG_MAKEFILE(dlls/xapofx1_3) diff --git a/dlls/xactengine3_0/Makefile.in b/dlls/xactengine3_0/Makefile.in new file mode 100644 -index 0000000000..0353039913 +index 00000000000..03530399135 --- /dev/null +++ b/dlls/xactengine3_0/Makefile.in @@ -0,0 +1,12 @@ @@ -105,7 +105,7 @@ index 0000000000..0353039913 +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_0/xactengine3_0.spec b/dlls/xactengine3_0/xactengine3_0.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_0/xactengine3_0.spec @@ -0,0 +1,4 @@ @@ -115,7 +115,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in new file mode 100644 -index 0000000000..b065b92d9a +index 00000000000..b065b92d9a9 --- /dev/null +++ b/dlls/xactengine3_1/Makefile.in @@ -0,0 +1,12 @@ @@ -133,7 +133,7 @@ index 0000000000..b065b92d9a +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_1/xactengine3_1.spec b/dlls/xactengine3_1/xactengine3_1.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_1/xactengine3_1.spec @@ -0,0 +1,4 @@ @@ -143,7 +143,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in new file mode 100644 -index 0000000000..6e4e065534 +index 00000000000..6e4e0655348 --- /dev/null +++ b/dlls/xactengine3_2/Makefile.in @@ -0,0 +1,12 @@ @@ -161,7 +161,7 @@ index 0000000000..6e4e065534 +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_2/xactengine3_2.spec b/dlls/xactengine3_2/xactengine3_2.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_2/xactengine3_2.spec @@ -0,0 +1,4 @@ @@ -171,7 +171,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in new file mode 100644 -index 0000000000..a8eebc03b2 +index 00000000000..a8eebc03b28 --- /dev/null +++ b/dlls/xactengine3_3/Makefile.in @@ -0,0 +1,12 @@ @@ -189,7 +189,7 @@ index 0000000000..a8eebc03b2 +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_3/xactengine3_3.spec b/dlls/xactengine3_3/xactengine3_3.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_3/xactengine3_3.spec @@ -0,0 +1,4 @@ @@ -199,7 +199,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in new file mode 100644 -index 0000000000..967acb7bcc +index 00000000000..967acb7bcce --- /dev/null +++ b/dlls/xactengine3_4/Makefile.in @@ -0,0 +1,12 @@ @@ -217,7 +217,7 @@ index 0000000000..967acb7bcc +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_4/xactengine3_4.spec b/dlls/xactengine3_4/xactengine3_4.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_4/xactengine3_4.spec @@ -0,0 +1,4 @@ @@ -227,7 +227,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in new file mode 100644 -index 0000000000..16e8b00b5e +index 00000000000..16e8b00b5ef --- /dev/null +++ b/dlls/xactengine3_5/Makefile.in @@ -0,0 +1,12 @@ @@ -245,7 +245,7 @@ index 0000000000..16e8b00b5e +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_5/xactengine3_5.spec b/dlls/xactengine3_5/xactengine3_5.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_5/xactengine3_5.spec @@ -0,0 +1,4 @@ @@ -255,7 +255,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in new file mode 100644 -index 0000000000..d226331aaf +index 00000000000..d226331aafc --- /dev/null +++ b/dlls/xactengine3_6/Makefile.in @@ -0,0 +1,12 @@ @@ -273,7 +273,7 @@ index 0000000000..d226331aaf +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_6/xactengine3_6.spec b/dlls/xactengine3_6/xactengine3_6.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_6/xactengine3_6.spec @@ -0,0 +1,4 @@ @@ -283,7 +283,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in new file mode 100644 -index 0000000000..080bc8a13b +index 00000000000..080bc8a13b7 --- /dev/null +++ b/dlls/xactengine3_7/Makefile.in @@ -0,0 +1,12 @@ @@ -301,7 +301,7 @@ index 0000000000..080bc8a13b +IDL_SRCS = xact_classes.idl diff --git a/dlls/xactengine3_7/xactengine3_7.spec b/dlls/xactengine3_7/xactengine3_7.spec new file mode 100644 -index 0000000000..b16365d0c9 +index 00000000000..b16365d0c9f --- /dev/null +++ b/dlls/xactengine3_7/xactengine3_7.spec @@ -0,0 +1,4 @@ @@ -310,7 +310,7 @@ index 0000000000..b16365d0c9 +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in -index 294f841b01..f27ce9f87e 100644 +index 294f841b019..f27ce9f87e4 100644 --- a/dlls/xaudio2_7/Makefile.in +++ b/dlls/xaudio2_7/Makefile.in @@ -7,9 +7,12 @@ EXTRAINCL = $(FAUDIO_CFLAGS) @@ -329,7 +329,7 @@ index 294f841b01..f27ce9f87e 100644 + xaudio_classes.idl diff --git a/dlls/xaudio2_7/xact_classes.idl b/dlls/xaudio2_7/xact_classes.idl new file mode 100644 -index 0000000000..89418dbe1a +index 00000000000..89418dbe1a0 --- /dev/null +++ b/dlls/xaudio2_7/xact_classes.idl @@ -0,0 +1,93 @@ @@ -428,10 +428,10 @@ index 0000000000..89418dbe1a +#endif /* XACT3_VER == 0x0300 */ diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c new file mode 100644 -index 0000000000..07f866606d +index 00000000000..a9e5a2b7826 --- /dev/null +++ b/dlls/xaudio2_7/xact_dll.c -@@ -0,0 +1,1387 @@ +@@ -0,0 +1,1239 @@ +/* + * Copyright (c) 2018 Ethan Lee for CodeWeavers + * @@ -506,9 +506,6 @@ index 0000000000..07f866606d + +typedef struct _XACT3CueImpl { + IXACT3Cue IXACT3Cue_iface; -+#if XACT3_VER <= 0x0304 -+ IXACT34Cue IXACT34Cue_iface; -+#endif + + FACTCue *fact_cue; +} XACT3CueImpl; @@ -714,135 +711,6 @@ index 0000000000..07f866606d + IXACT3CueImpl_SetOutputVoiceMatrix +}; + -+#if XACT3_VER <= 0x0304 -+static inline XACT3CueImpl *impl_from_IXACT34Cue(IXACT34Cue *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3CueImpl, IXACT34Cue_iface); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_Play(IXACT34Cue *iface) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)\n", iface); -+ -+ return FACTCue_Play(This->fact_cue); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_Stop(IXACT34Cue *iface, DWORD dwFlags) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%u)\n", iface, dwFlags); -+ -+ return FACTCue_Stop(This->fact_cue, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_GetState(IXACT34Cue *iface, DWORD *pdwState) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%p)\n", iface, pdwState); -+ -+ return FACTCue_GetState(This->fact_cue, pdwState); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_Destroy(IXACT34Cue *iface) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)\n", iface); -+ -+ hr = FACTCue_Destroy(This->fact_cue); -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_SetMatrixCoefficients(IXACT34Cue *iface, -+ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, -+ float *pMatrixCoefficients) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%u, %u, %p)\n", iface, uSrcChannelCount, uDstChannelCount, -+ pMatrixCoefficients); -+ -+ return FACTCue_SetMatrixCoefficients(This->fact_cue, uSrcChannelCount, -+ uDstChannelCount, pMatrixCoefficients); -+} -+ -+static XACTVARIABLEINDEX WINAPI IXACT34CueImpl_GetVariableIndex(IXACT34Cue *iface, -+ PCSTR szFriendlyName) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%s)\n", iface, szFriendlyName); -+ -+ return FACTCue_GetVariableIndex(This->fact_cue, szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_SetVariable(IXACT34Cue *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%u, %f)\n", iface, nIndex, nValue); -+ -+ return FACTCue_SetVariable(This->fact_cue, nIndex, nValue); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_GetVariable(IXACT34Cue *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE *nValue) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%u, %p)\n", iface, nIndex, nValue); -+ -+ return FACTCue_GetVariable(This->fact_cue, nIndex, nValue); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_Pause(IXACT34Cue *iface, BOOL fPause) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ -+ TRACE("(%p)->(%u)\n", iface, fPause); -+ -+ return FACTCue_Pause(This->fact_cue, fPause); -+} -+ -+static HRESULT WINAPI IXACT34CueImpl_GetProperties(IXACT34Cue *iface, -+ XACT_CUE_INSTANCE_PROPERTIES **ppProperties) -+{ -+ XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -+ FACTCueInstanceProperties *fProps; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", iface, ppProperties); -+ -+ hr = FACTCue_GetProperties(This->fact_cue, &fProps); -+ if(FAILED(hr)) -+ return hr; -+ -+ *ppProperties = (XACT_CUE_INSTANCE_PROPERTIES*) fProps; -+ return hr; -+} -+ -+static const IXACT34CueVtbl XACT34Cue_Vtbl = -+{ -+ IXACT34CueImpl_Play, -+ IXACT34CueImpl_Stop, -+ IXACT34CueImpl_GetState, -+ IXACT34CueImpl_Destroy, -+ IXACT34CueImpl_SetMatrixCoefficients, -+ IXACT34CueImpl_GetVariableIndex, -+ IXACT34CueImpl_SetVariable, -+ IXACT34CueImpl_GetVariable, -+ IXACT34CueImpl_Pause, -+ IXACT34CueImpl_GetProperties -+}; -+#endif -+ +static inline XACT3WaveImpl *impl_from_IXACT3Wave(IXACT3Wave *iface) +{ + return CONTAINING_RECORD(iface, XACT3WaveImpl, IXACT3Wave_iface); @@ -1012,15 +880,8 @@ index 0000000000..07f866606d + } + + cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl; -+#if XACT3_VER <= 0x0304 -+ cue->IXACT34Cue_iface.lpVtbl = &XACT34Cue_Vtbl; -+#endif + cue->fact_cue = fcue; -+#if XACT3_VER <= 0x0304 -+ *ppCue = (IXACT3Cue*)&cue->IXACT34Cue_iface; -+#else + *ppCue = (IXACT3Cue*)&cue->IXACT3Cue_iface; -+#endif + + TRACE("Created Cue: %p\n", cue); + @@ -1060,17 +921,8 @@ index 0000000000..07f866606d + } + + cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl; -+#if XACT3_VER <= 0x0304 -+ cue->IXACT34Cue_iface.lpVtbl = &XACT34Cue_Vtbl; -+#endif + cue->fact_cue = fcue; -+#if XACT3_VER <= 0x0304 -+ *ppCue = (IXACT3Cue*)&cue->IXACT34Cue_iface; -+#else + *ppCue = (IXACT3Cue*)&cue->IXACT3Cue_iface; -+#endif -+ cue->fact_cue = fcue; -+ *ppCue = (IXACT3Cue*)cue; + } + + return hr; @@ -1820,5 +1672,5 @@ index 0000000000..07f866606d + +#endif -- -2.25.1 +2.27.0 diff --git a/patches/xactengine-initial/0006-xaudio2_7-Always-return-S_OK-in-IXACT34Cue-Destroy.patch b/patches/xactengine-initial/0006-xaudio2_7-Always-return-S_OK-in-IXACT34Cue-Destroy.patch index 3241d56d..4b0bf60e 100644 --- a/patches/xactengine-initial/0006-xaudio2_7-Always-return-S_OK-in-IXACT34Cue-Destroy.patch +++ b/patches/xactengine-initial/0006-xaudio2_7-Always-return-S_OK-in-IXACT34Cue-Destroy.patch @@ -1,32 +1,38 @@ -From 94df3565a9109176ee936416804f325b5fde9627 Mon Sep 17 00:00:00 2001 +From 4963145cb0fd3713de75ac0f0913953980cd7519 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Jan 2020 12:34:53 +1100 Subject: [PATCH] xaudio2_7: Always return S_OK in IXACT34Cue Destroy --- - dlls/xaudio2_7/xact_dll.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) + dlls/xaudio2_7/xact_dll.c | 8 ++++++++ + 1 file changed, 8 insertions(+) diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c -index 9cec216002..2bf6eaf374 100644 +index b2cfcfb4068..4900e51802e 100644 --- a/dlls/xaudio2_7/xact_dll.c +++ b/dlls/xaudio2_7/xact_dll.c -@@ -320,13 +320,12 @@ static HRESULT WINAPI IXACT34CueImpl_GetState(IXACT34Cue *iface, DWORD *pdwState - static HRESULT WINAPI IXACT34CueImpl_Destroy(IXACT34Cue *iface) +@@ -170,6 +170,7 @@ static HRESULT WINAPI IXACT3CueImpl_GetState(IXACT3Cue *iface, DWORD *pdwState) + static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface) { - XACT3CueImpl *This = impl_from_IXACT34Cue(iface); -- HRESULT hr; + XACT3CueImpl *This = impl_from_IXACT3Cue(iface); ++#if XACT3_VER > 0x0304 + HRESULT hr; TRACE("(%p)\n", iface); - -- hr = FACTCue_Destroy(This->fact_cue); -+ FACTCue_Destroy(This->fact_cue); +@@ -177,6 +178,13 @@ static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface) + hr = FACTCue_Destroy(This->fact_cue); HeapFree(GetProcessHeap(), 0, This); -- return hr; + return hr; ++#else ++ TRACE("(%p)\n", iface); ++ ++ FACTCue_Destroy(This->fact_cue); ++ HeapFree(GetProcessHeap(), 0, This); + return S_OK; ++#endif } - static HRESULT WINAPI IXACT34CueImpl_SetMatrixCoefficients(IXACT34Cue *iface, + static HRESULT WINAPI IXACT3CueImpl_SetMatrixCoefficients(IXACT3Cue *iface, -- -2.25.1 +2.27.0