From 7c1249e5c05edf5acc9419d55642990540a32e54 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 6 Aug 2020 18:17:01 -0500 Subject: [PATCH] Rebase against 8cbbb4f394678411fdb57237553f5d974527877f. --- ...l-program-with-support-for-creating-.patch | 256 --- patches/fsutil-Stub_Program/definition | 1 - patches/patchinstall.sh | 21 +- ...-xaudio2-Add-support-for-xactengine3.patch | 1676 ----------------- ...Support-older-XACT3Engine-interfaces.patch | 41 - ...Engine-CreateSoundBank-return-correc.patch | 93 - ...-unwrap-structure-based-of-it-s-type.patch | 106 -- staging/upstream-commit | 2 +- 8 files changed, 2 insertions(+), 2194 deletions(-) delete mode 100644 patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch delete mode 100644 patches/fsutil-Stub_Program/definition delete mode 100644 patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch delete mode 100644 patches/xactengine-initial/0003-xaudio2_7-Support-older-XACT3Engine-interfaces.patch delete mode 100644 patches/xactengine-initial/0005-xaudio2_7-IXACT3Engine-CreateSoundBank-return-correc.patch delete mode 100644 patches/xactengine-initial/0009-xaudio2_7-unwrap-structure-based-of-it-s-type.patch diff --git a/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch b/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch deleted file mode 100644 index b779b3cf..00000000 --- a/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch +++ /dev/null @@ -1,256 +0,0 @@ -From b0eec9e5d8736bfa86096fd2d69cfb73dba7a5fe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 1 Apr 2016 01:29:51 +0200 -Subject: [PATCH] fsutil: Add fsutil program with support for creating hard - links. - ---- - programs/fsutil/Makefile.in | 3 + - programs/fsutil/fsutil.rc | 34 ++++++++++ - programs/fsutil/main.c | 130 ++++++++++++++++++++++++++++++++++-- - programs/fsutil/resources.h | 25 +++++++ - 4 files changed, 186 insertions(+), 6 deletions(-) - create mode 100644 programs/fsutil/fsutil.rc - create mode 100644 programs/fsutil/resources.h - -diff --git a/programs/fsutil/Makefile.in b/programs/fsutil/Makefile.in -index 64307e83aca..e10bd433baa 100644 ---- a/programs/fsutil/Makefile.in -+++ b/programs/fsutil/Makefile.in -@@ -1,6 +1,9 @@ - MODULE = fsutil.exe - - EXTRADLLFLAGS = -mconsole -municode -mno-cygwin -+IMPORTS = user32 - - C_SRCS = \ - main.c -+ -+RC_SRCS = fsutil.rc -diff --git a/programs/fsutil/fsutil.rc b/programs/fsutil/fsutil.rc -new file mode 100644 -index 00000000000..593f8175a23 ---- /dev/null -+++ b/programs/fsutil/fsutil.rc -@@ -0,0 +1,34 @@ -+/* -+ * FSUTIL.EXE - Wine-compatible fsutil program -+ * -+ * Copyright 2016 Michael Müller -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "resources.h" -+ -+#pragma makedep po -+ -+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT -+ -+STRINGTABLE -+{ -+ STRING_USAGE, "---- Commands Supported ----\n\nhardlink Hardlink management\n\n" -+ STRING_UNSUPPORTED_CMD, "%1 is an unsupported command\n" -+ STRING_UNSUPPORTED_PARAM, "%1 is an unsupported parameter\n" -+ STRING_HARDLINK_USAGE, "---- Hardlink - Commands Supported ----\n\ncreate Create a hardlink.\n\n" -+ STRING_HARDLINK_CREATE_USAGE, "Syntax: fsutil hardlink create old new\n\n" -+} -diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c -index eb4e3412976..ffef8aecbb1 100644 ---- a/programs/fsutil/main.c -+++ b/programs/fsutil/main.c -@@ -1,5 +1,6 @@ - /* - * Copyright 2016 Austin English -+ * Copyright 2016 Michael Müller - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -16,18 +17,135 @@ - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - --#include "wine/debug.h" -+#include -+#include -+ -+#include "resources.h" - - WINE_DEFAULT_DEBUG_CHANNEL(fsutil); - -+static void output_write(const WCHAR *str, DWORD wlen) -+{ -+ DWORD count, ret; -+ -+ ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL); -+ if (!ret) -+ { -+ DWORD len; -+ char *msgA; -+ -+ /* On Windows WriteConsoleW() fails if the output is redirected. So fall -+ * back to WriteFile(), assuming the console encoding is still the right -+ * one in that case. -+ */ -+ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL); -+ msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char)); -+ if (!msgA) return; -+ -+ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL); -+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE); -+ HeapFree(GetProcessHeap(), 0, msgA); -+ } -+} -+ -+static int output_vprintf(const WCHAR* fmt, __ms_va_list va_args) -+{ -+ WCHAR str[8192]; -+ int len; -+ -+ SetLastError(NO_ERROR); -+ len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, fmt, 0, 0, str, -+ sizeof(str)/sizeof(*str), &va_args); -+ if (len == 0 && GetLastError() != NO_ERROR) -+ WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt)); -+ else -+ output_write(str, len); -+ return 0; -+} -+ -+static int WINAPIV output_string(int msg, ...) -+{ -+ WCHAR fmt[8192]; -+ __ms_va_list arguments; -+ -+ LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)/sizeof(fmt[0])); -+ __ms_va_start(arguments, msg); -+ output_vprintf(fmt, arguments); -+ __ms_va_end(arguments); -+ return 0; -+} -+ -+static BOOL output_error_string(DWORD error) -+{ -+ LPWSTR pBuffer; -+ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | -+ FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, -+ NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL)) -+ { -+ output_write(pBuffer, lstrlenW(pBuffer)); -+ LocalFree(pBuffer); -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+static int create_hardlink(int argc, WCHAR *argv[]) -+{ -+ if (argc != 5) -+ { -+ output_string(STRING_HARDLINK_CREATE_USAGE); -+ return 1; -+ } -+ -+ if (CreateHardLinkW(argv[3], argv[4], NULL)) -+ return 0; -+ -+ output_error_string(GetLastError()); -+ return 1; -+} -+ -+static int hardlink(int argc, WCHAR *argv[]) -+{ -+ static const WCHAR createW[]={'c','r','e','a','t','e',0}; -+ int ret; -+ -+ if (argc > 2) -+ { -+ if (!_wcsicmp(argv[2], createW)) -+ return create_hardlink(argc, argv); -+ else -+ { -+ FIXME("unsupported parameter %s\n", debugstr_w(argv[2])); -+ output_string(STRING_UNSUPPORTED_PARAM, argv[2]); -+ ret = 1; -+ } -+ } -+ -+ output_string(STRING_HARDLINK_USAGE); -+ return ret; -+} -+ - int __cdecl wmain(int argc, WCHAR *argv[]) - { -- int i; -+ static const WCHAR hardlinkW[]={'h','a','r','d','l','i','n','k',0}; -+ int i, ret = 0; - -- WINE_FIXME("stub:"); - for (i = 0; i < argc; i++) -- WINE_FIXME(" %s", wine_dbgstr_w(argv[i])); -- WINE_FIXME("\n"); -+ WINE_TRACE(" %s", wine_dbgstr_w(argv[i])); -+ WINE_TRACE("\n"); - -- return 0; -+ if (argc > 1) -+ { -+ if (!_wcsicmp(argv[1], hardlinkW)) -+ return hardlink(argc, argv); -+ else -+ { -+ FIXME("unsupported command %s\n", debugstr_w(argv[1])); -+ output_string(STRING_UNSUPPORTED_CMD, argv[1]); -+ ret = 1; -+ } -+ } -+ -+ output_string(STRING_USAGE); -+ return ret; - } -diff --git a/programs/fsutil/resources.h b/programs/fsutil/resources.h -new file mode 100644 -index 00000000000..b85826ac421 ---- /dev/null -+++ b/programs/fsutil/resources.h -@@ -0,0 +1,25 @@ -+/* -+ * Copyright 2016 Michael Müller -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include -+ -+#define STRING_USAGE 101 -+#define STRING_UNSUPPORTED_CMD 102 -+#define STRING_UNSUPPORTED_PARAM 103 -+#define STRING_HARDLINK_USAGE 104 -+#define STRING_HARDLINK_CREATE_USAGE 105 --- -2.17.1 - diff --git a/patches/fsutil-Stub_Program/definition b/patches/fsutil-Stub_Program/definition deleted file mode 100644 index f400d6a1..00000000 --- a/patches/fsutil-Stub_Program/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [22749] Add stub for fsutil.exe hardlink command diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e6d669a0..8ba571f3 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f7895ef25a4cb2115ffbe04d28b87bcb6ee3c0b7" + echo "8cbbb4f394678411fdb57237553f5d974527877f" } # Show version information @@ -132,7 +132,6 @@ patch_enable_all () enable_dxdiagn_GetChildContainer_Leaf_Nodes="$1" enable_explorer_Video_Registry_Key="$1" enable_fonts_Missing_Fonts="$1" - enable_fsutil_Stub_Program="$1" enable_gdi32_Lazy_Font_Initialization="$1" enable_gdi32_rotation="$1" enable_gdiplus_Performance_Improvements="$1" @@ -486,9 +485,6 @@ patch_enable () fonts-Missing_Fonts) enable_fonts_Missing_Fonts="$2" ;; - fsutil-Stub_Program) - enable_fsutil_Stub_Program="$2" - ;; gdi32-Lazy_Font_Initialization) enable_gdi32_Lazy_Font_Initialization="$2" ;; @@ -2862,21 +2858,6 @@ if test "$enable_fonts_Missing_Fonts" -eq 1; then ) >> "$patchlist" fi -# Patchset fsutil-Stub_Program -# | -# | This patchset fixes the following Wine bugs: -# | * [#22749] Add stub for fsutil.exe hardlink command -# | -# | Modified files: -# | * programs/fsutil/Makefile.in, programs/fsutil/fsutil.rc, programs/fsutil/main.c, programs/fsutil/resources.h -# | -if test "$enable_fsutil_Stub_Program" -eq 1; then - patch_apply fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch - ( - printf '%s\n' '+ { "Michael Müller", "fsutil: Add fsutil program with support for creating hard links.", 1 },'; - ) >> "$patchlist" -fi - # Patchset gdi32-Lazy_Font_Initialization # | # | Modified files: diff --git a/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch b/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch deleted file mode 100644 index 38271cbb..00000000 --- a/patches/xactengine-initial/0002-xaudio2-Add-support-for-xactengine3.patch +++ /dev/null @@ -1,1676 +0,0 @@ -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 - -v2: Remove references to IXAudio2/IXAudio2Voice internals - -v3: Uses 0x030* for the version. - #if out xact_dll.c from the xaudio solution. - Use a static ClassFactory interface. - -Signed-off-by: Ethan Lee ---- - configure.ac | 16 + - dlls/xactengine3_0/Makefile.in | 12 + - dlls/xactengine3_0/xactengine3_0.spec | 4 + - dlls/xactengine3_1/Makefile.in | 12 + - dlls/xactengine3_1/xactengine3_1.spec | 4 + - dlls/xactengine3_2/Makefile.in | 12 + - dlls/xactengine3_2/xactengine3_2.spec | 4 + - dlls/xactengine3_3/Makefile.in | 12 + - dlls/xactengine3_3/xactengine3_3.spec | 4 + - dlls/xactengine3_4/Makefile.in | 12 + - dlls/xactengine3_4/xactengine3_4.spec | 4 + - dlls/xactengine3_5/Makefile.in | 12 + - dlls/xactengine3_5/xactengine3_5.spec | 4 + - dlls/xactengine3_6/Makefile.in | 12 + - dlls/xactengine3_6/xactengine3_6.spec | 4 + - dlls/xactengine3_7/Makefile.in | 12 + - 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 | 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 - create mode 100644 dlls/xactengine3_1/xactengine3_1.spec - create mode 100644 dlls/xactengine3_2/Makefile.in - create mode 100644 dlls/xactengine3_2/xactengine3_2.spec - create mode 100644 dlls/xactengine3_3/Makefile.in - create mode 100644 dlls/xactengine3_3/xactengine3_3.spec - create mode 100644 dlls/xactengine3_4/Makefile.in - create mode 100644 dlls/xactengine3_4/xactengine3_4.spec - create mode 100644 dlls/xactengine3_5/Makefile.in - create mode 100644 dlls/xactengine3_5/xactengine3_5.spec - create mode 100644 dlls/xactengine3_6/Makefile.in - create mode 100644 dlls/xactengine3_6/xactengine3_6.spec - create mode 100644 dlls/xactengine3_7/Makefile.in - create mode 100644 dlls/xactengine3_7/xactengine3_7.spec - create mode 100644 dlls/xaudio2_7/xact_classes.idl - create mode 100644 dlls/xaudio2_7/xact_dll.c - -diff --git a/configure.ac b/configure.ac -index d5964223204..10e804090e2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -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} -+ enable_xactengine3_0=${enable_xactengine3_0:-no} -+ enable_xactengine3_1=${enable_xactengine3_1:-no} -+ enable_xactengine3_2=${enable_xactengine3_2:-no} -+ enable_xactengine3_3=${enable_xactengine3_3:-no} -+ enable_xactengine3_4=${enable_xactengine3_4:-no} -+ enable_xactengine3_5=${enable_xactengine3_5:-no} -+ enable_xactengine3_6=${enable_xactengine3_6:-no} -+ enable_xactengine3_7=${enable_xactengine3_7:-no} - enable_xapofx1_1=${enable_xapofx1_1:-no} - enable_xapofx1_2=${enable_xapofx1_2:-no} - enable_xapofx1_3=${enable_xapofx1_3:-no} -@@ -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) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_0) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_1) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_2) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_3) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_4) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_5) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_6) -+WINE_CONFIG_MAKEFILE(dlls/xactengine3_7) - WINE_CONFIG_MAKEFILE(dlls/xapofx1_1) - WINE_CONFIG_MAKEFILE(dlls/xapofx1_2) - 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 00000000000..03530399135 ---- /dev/null -+++ b/dlls/xactengine3_0/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0300 -+MODULE = xactengine3_0.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_0/xactengine3_0.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_1/Makefile.in b/dlls/xactengine3_1/Makefile.in -new file mode 100644 -index 00000000000..b065b92d9a9 ---- /dev/null -+++ b/dlls/xactengine3_1/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0301 -+MODULE = xactengine3_1.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_1/xactengine3_1.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_2/Makefile.in b/dlls/xactengine3_2/Makefile.in -new file mode 100644 -index 00000000000..6e4e0655348 ---- /dev/null -+++ b/dlls/xactengine3_2/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0302 -+MODULE = xactengine3_2.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_2/xactengine3_2.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_3/Makefile.in b/dlls/xactengine3_3/Makefile.in -new file mode 100644 -index 00000000000..a8eebc03b28 ---- /dev/null -+++ b/dlls/xactengine3_3/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0303 -+MODULE = xactengine3_3.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_3/xactengine3_3.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_4/Makefile.in b/dlls/xactengine3_4/Makefile.in -new file mode 100644 -index 00000000000..967acb7bcce ---- /dev/null -+++ b/dlls/xactengine3_4/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0304 -+MODULE = xactengine3_4.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_4/xactengine3_4.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_5/Makefile.in b/dlls/xactengine3_5/Makefile.in -new file mode 100644 -index 00000000000..16e8b00b5ef ---- /dev/null -+++ b/dlls/xactengine3_5/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0305 -+MODULE = xactengine3_5.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_5/xactengine3_5.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_6/Makefile.in b/dlls/xactengine3_6/Makefile.in -new file mode 100644 -index 00000000000..d226331aafc ---- /dev/null -+++ b/dlls/xactengine3_6/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0306 -+MODULE = xactengine3_6.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_6/xactengine3_6.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in -new file mode 100644 -index 00000000000..080bc8a13b7 ---- /dev/null -+++ b/dlls/xactengine3_7/Makefile.in -@@ -0,0 +1,12 @@ -+EXTRADEFS = -DXACT3_VER=0x0307 -+MODULE = xactengine3_7.dll -+IMPORTS = advapi32 ole32 user32 uuid -+PARENTSRC = ../xaudio2_7 -+EXTRALIBS = $(FAUDIO_LIBS) -+EXTRAINCL = $(FAUDIO_CFLAGS) -+ -+C_SRCS = \ -+ xact_dll.c \ -+ xaudio_allocator.c -+ -+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 00000000000..b16365d0c9f ---- /dev/null -+++ b/dlls/xactengine3_7/xactengine3_7.spec -@@ -0,0 +1,4 @@ -+@ stdcall -private DllCanUnloadNow() -+@ stdcall -private DllGetClassObject(ptr ptr ptr) -+@ stdcall -private DllRegisterServer() -+@ stdcall -private DllUnregisterServer() -diff --git a/dlls/xaudio2_7/Makefile.in b/dlls/xaudio2_7/Makefile.in -index 294f841b019..f27ce9f87e4 100644 ---- a/dlls/xaudio2_7/Makefile.in -+++ b/dlls/xaudio2_7/Makefile.in -@@ -7,9 +7,12 @@ EXTRAINCL = $(FAUDIO_CFLAGS) - C_SRCS = \ - compat.c \ - x3daudio.c \ -+ xact_dll.c \ - xapo.c \ - xapofx.c \ - xaudio_allocator.c \ - xaudio_dll.c - --IDL_SRCS = xaudio_classes.idl -+IDL_SRCS = \ -+ xact_classes.idl \ -+ xaudio_classes.idl -diff --git a/dlls/xaudio2_7/xact_classes.idl b/dlls/xaudio2_7/xact_classes.idl -new file mode 100644 -index 00000000000..89418dbe1a0 ---- /dev/null -+++ b/dlls/xaudio2_7/xact_classes.idl -@@ -0,0 +1,93 @@ -+/* -+ * COM Classes for xactengine -+ * -+ * Copyright 2018 Ethan Lee for CodeWeavers -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#pragma makedep register -+ -+#if XACT3_VER == 0x0307 -+[ -+ helpstring("XACT3 Class"), -+ threading(both), -+ uuid(bcc782bc-6492-4c22-8c35-f5d72fe73c6e) -+] -+coclass XACTEngine37 { interface IXACT37Engine; } -+#endif /* XACT3_VER == 0x0307 */ -+ -+#if XACT3_VER == 0x0306 -+[ -+ helpstring("XACT3.6 Class"), -+ threading(both), -+ uuid(248d8a3b-6256-44d3-a018-2ac96c459f47) -+] -+coclass XACTEngine36 { interface IXACT37Engine; } -+#endif /* XACT3_VER == 0x0306 */ -+ -+#if XACT3_VER == 0x0305 -+[ -+ helpstring("XACT3.5 Class"), -+ threading(both), -+ uuid(074b110f-7f58-4743-aea5-12f15b5074ed) -+] -+coclass XACTEngine35 { interface IXACT37Engine; } -+#endif /* XACT3_VER == 0x0305 */ -+ -+#if XACT3_VER == 0x0304 -+[ -+ helpstring("XACT3.4 Class"), -+ threading(both), -+ uuid(0977d092-2d95-4e43-8d42-9ddcc2545ed5) -+] -+coclass XACTEngine34 { interface IXACT37Engine; } -+#endif /* XACT3_VER == 0x0304 */ -+ -+#if XACT3_VER == 0x0303 -+[ -+ helpstring("XACT3.3 Class"), -+ threading(both), -+ uuid(94c1affa-66e7-4961-9521-cfdef3128d4f) -+] -+coclass XACTEngine33 { interface IXACT37Engine; } -+#endif /* XACT3_VER == 0x0303 */ -+ -+#if XACT3_VER == 0x0302 -+[ -+ helpstring("XACT3.2 Class"), -+ threading(both), -+ uuid(d3332f02-3dd0-4de9-9aec-20d85c4111b6) -+] -+coclass XACTEngine32 { interface IXACT32Engine; } -+#endif /* XACT3_VER == 0x0302 */ -+ -+#if XACT3_VER == 0x0301 -+[ -+ helpstring("XACT3.1 Class"), -+ threading(both), -+ uuid(962f5027-99be-4692-a468-85802cf8de61) -+] -+coclass XACTEngine31 { interface IXACT32Engine; } -+#endif /* XACT3_VER == 0x0301 */ -+ -+#if XACT3_VER == 0x0300 -+[ -+ helpstring("XACT3.0 Class"), -+ threading(both), -+ uuid(3b80ee2a-b0f5-4780-9e30-90cb39685b03) -+] -+coclass XACTEngine30 { interface IXACT30Engine; } -+#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 00000000000..a9e5a2b7826 ---- /dev/null -+++ b/dlls/xaudio2_7/xact_dll.c -@@ -0,0 +1,1239 @@ -+/* -+ * Copyright (c) 2018 Ethan Lee for CodeWeavers -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+#ifdef XACT3_VER -+ -+#include "config.h" -+ -+#include -+ -+#define NONAMELESSUNION -+#define COBJMACROS -+ -+#include "xaudio_private.h" -+ -+#include "initguid.h" -+#include "xact3.h" -+#include -+ -+#include "rpcproxy.h" -+#include "wine/debug.h" -+ -+#include -+ -+WINE_DEFAULT_DEBUG_CHANNEL(xact3); -+ -+static HINSTANCE instance; -+ -+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) -+{ -+ TRACE("(%p, %d, %p)\n", hinstDLL, reason, pReserved); -+ -+ switch (reason) -+ { -+ case DLL_PROCESS_ATTACH: -+ instance = hinstDLL; -+ DisableThreadLibraryCalls( hinstDLL ); -+ break; -+ } -+ return TRUE; -+} -+ -+HRESULT WINAPI DllCanUnloadNow(void) -+{ -+ return S_FALSE; -+} -+ -+HRESULT WINAPI DllRegisterServer(void) -+{ -+ TRACE("\n"); -+ return __wine_register_resources(instance); -+} -+ -+HRESULT WINAPI DllUnregisterServer(void) -+{ -+ TRACE("\n"); -+ return __wine_unregister_resources(instance); -+} -+ -+typedef struct _XACT3CueImpl { -+ IXACT3Cue IXACT3Cue_iface; -+ -+ FACTCue *fact_cue; -+} XACT3CueImpl; -+ -+typedef struct _XACT3WaveImpl { -+ IXACT3Wave IXACT3Wave_iface; -+ -+ FACTWave *fact_wave; -+} XACT3WaveImpl; -+ -+typedef struct _XACT3SoundBankImpl { -+ IXACT3SoundBank IXACT3SoundBank_iface; -+ -+ FACTSoundBank *fact_soundbank; -+} XACT3SoundBankImpl; -+ -+typedef struct _XACT3WaveBankImpl { -+ IXACT3WaveBank IXACT3WaveBank_iface; -+ -+ FACTWaveBank *fact_wavebank; -+} XACT3WaveBankImpl; -+ -+typedef struct _XACT3EngineImpl { -+ IXACT3Engine IXACT3Engine_iface; -+ -+ FACTAudioEngine *fact_engine; -+ -+ XACT_READFILE_CALLBACK pReadFile; -+ XACT_GETOVERLAPPEDRESULT_CALLBACK pGetOverlappedResult; -+} XACT3EngineImpl; -+ -+typedef struct wrap_readfile_struct { -+ XACT3EngineImpl *engine; -+ HANDLE file; -+} wrap_readfile_struct; -+ -+static int32_t FACTCALL wrap_readfile( -+ void* hFile, -+ void* lpBuffer, -+ uint32_t nNumberOfBytesRead, -+ uint32_t *lpNumberOfBytesRead, -+ FACTOverlapped *lpOverlapped -+) { -+ wrap_readfile_struct *wrap = (wrap_readfile_struct*) hFile; -+ return wrap->engine->pReadFile(wrap->file, lpBuffer, nNumberOfBytesRead, -+ lpNumberOfBytesRead, lpOverlapped); -+} -+ -+static int32_t FACTCALL wrap_getoverlappedresult( -+ void* hFile, -+ FACTOverlapped *lpOverlapped, -+ uint32_t *lpNumberOfBytesTransferred, -+ int32_t bWait -+) { -+ wrap_readfile_struct *wrap = (wrap_readfile_struct*) hFile; -+ return wrap->engine->pGetOverlappedResult(wrap->file, lpOverlapped, -+ lpNumberOfBytesTransferred, bWait); -+} -+ -+static inline XACT3CueImpl *impl_from_IXACT3Cue(IXACT3Cue *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3CueImpl, IXACT3Cue_iface); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_Play(IXACT3Cue *iface) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)\n", iface); -+ -+ return FACTCue_Play(This->fact_cue); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_Stop(IXACT3Cue *iface, DWORD dwFlags) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%u)\n", iface, dwFlags); -+ -+ return FACTCue_Stop(This->fact_cue, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_GetState(IXACT3Cue *iface, DWORD *pdwState) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%p)\n", iface, pdwState); -+ -+ return FACTCue_GetState(This->fact_cue, pdwState); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_Destroy(IXACT3Cue *iface) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)\n", iface); -+ -+ hr = FACTCue_Destroy(This->fact_cue); -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_SetMatrixCoefficients(IXACT3Cue *iface, -+ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, -+ float *pMatrixCoefficients) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%u, %u, %p)\n", iface, uSrcChannelCount, uDstChannelCount, -+ pMatrixCoefficients); -+ -+ return FACTCue_SetMatrixCoefficients(This->fact_cue, uSrcChannelCount, -+ uDstChannelCount, pMatrixCoefficients); -+} -+ -+static XACTVARIABLEINDEX WINAPI IXACT3CueImpl_GetVariableIndex(IXACT3Cue *iface, -+ PCSTR szFriendlyName) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%s)\n", iface, szFriendlyName); -+ -+ return FACTCue_GetVariableIndex(This->fact_cue, szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_SetVariable(IXACT3Cue *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%u, %f)\n", iface, nIndex, nValue); -+ -+ return FACTCue_SetVariable(This->fact_cue, nIndex, nValue); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_GetVariable(IXACT3Cue *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE *nValue) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%u, %p)\n", iface, nIndex, nValue); -+ -+ return FACTCue_GetVariable(This->fact_cue, nIndex, nValue); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_Pause(IXACT3Cue *iface, BOOL fPause) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ -+ TRACE("(%p)->(%u)\n", iface, fPause); -+ -+ return FACTCue_Pause(This->fact_cue, fPause); -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_GetProperties(IXACT3Cue *iface, -+ XACT_CUE_INSTANCE_PROPERTIES **ppProperties) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(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 HRESULT WINAPI IXACT3CueImpl_SetOutputVoices(IXACT3Cue *iface, -+ const XAUDIO2_VOICE_SENDS *pSendList) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ FIXME("(%p): stub!\n", This); -+ return S_OK; -+} -+ -+static HRESULT WINAPI IXACT3CueImpl_SetOutputVoiceMatrix(IXACT3Cue *iface, -+ IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, -+ UINT32 DestinationChannels, const float *pLevelMatrix) -+{ -+ XACT3CueImpl *This = impl_from_IXACT3Cue(iface); -+ FIXME("(%p): stub!\n", This); -+ return S_OK; -+} -+ -+static const IXACT3CueVtbl XACT3Cue_Vtbl = -+{ -+ IXACT3CueImpl_Play, -+ IXACT3CueImpl_Stop, -+ IXACT3CueImpl_GetState, -+ IXACT3CueImpl_Destroy, -+ IXACT3CueImpl_SetMatrixCoefficients, -+ IXACT3CueImpl_GetVariableIndex, -+ IXACT3CueImpl_SetVariable, -+ IXACT3CueImpl_GetVariable, -+ IXACT3CueImpl_Pause, -+ IXACT3CueImpl_GetProperties, -+ IXACT3CueImpl_SetOutputVoices, -+ IXACT3CueImpl_SetOutputVoiceMatrix -+}; -+ -+static inline XACT3WaveImpl *impl_from_IXACT3Wave(IXACT3Wave *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3WaveImpl, IXACT3Wave_iface); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_Destroy(IXACT3Wave *iface) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)\n", This); -+ -+ hr = FACTWave_Destroy(This->fact_wave); -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_Play(IXACT3Wave *iface) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)\n", This); -+ -+ return FACTWave_Play(This->fact_wave); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_Stop(IXACT3Wave *iface, DWORD dwFlags) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(0x%x)\n", This, dwFlags); -+ -+ return FACTWave_Stop(This->fact_wave, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_Pause(IXACT3Wave *iface, BOOL fPause) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%u)\n", This, fPause); -+ -+ return FACTWave_Pause(This->fact_wave, fPause); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_GetState(IXACT3Wave *iface, DWORD *pdwState) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pdwState); -+ -+ return FACTWave_GetState(This->fact_wave, pdwState); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_SetPitch(IXACT3Wave *iface, XACTPITCH pitch) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%d)\n", This, pitch); -+ -+ return FACTWave_SetPitch(This->fact_wave, pitch); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_SetVolume(IXACT3Wave *iface, XACTVOLUME volume) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%f)\n", This, volume); -+ -+ return FACTWave_SetVolume(This->fact_wave, volume); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_SetMatrixCoefficients(IXACT3Wave *iface, -+ UINT32 uSrcChannelCount, UINT32 uDstChannelCount, -+ float *pMatrixCoefficients) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%u, %u, %p)\n", This, uSrcChannelCount, uDstChannelCount, -+ pMatrixCoefficients); -+ -+ return FACTWave_SetMatrixCoefficients(This->fact_wave, uSrcChannelCount, -+ uDstChannelCount, pMatrixCoefficients); -+} -+ -+static HRESULT WINAPI IXACT3WaveImpl_GetProperties(IXACT3Wave *iface, -+ XACT_WAVE_INSTANCE_PROPERTIES *pProperties) -+{ -+ XACT3WaveImpl *This = impl_from_IXACT3Wave(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pProperties); -+ -+ return FACTWave_GetProperties(This->fact_wave, -+ (FACTWaveInstanceProperties*) pProperties); -+} -+ -+static const IXACT3WaveVtbl XACT3Wave_Vtbl = -+{ -+ IXACT3WaveImpl_Destroy, -+ IXACT3WaveImpl_Play, -+ IXACT3WaveImpl_Stop, -+ IXACT3WaveImpl_Pause, -+ IXACT3WaveImpl_GetState, -+ IXACT3WaveImpl_SetPitch, -+ IXACT3WaveImpl_SetVolume, -+ IXACT3WaveImpl_SetMatrixCoefficients, -+ IXACT3WaveImpl_GetProperties -+}; -+ -+static inline XACT3SoundBankImpl *impl_from_IXACT3SoundBank(IXACT3SoundBank *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3SoundBankImpl, IXACT3SoundBank_iface); -+} -+ -+static XACTINDEX WINAPI IXACT3SoundBankImpl_GetCueIndex(IXACT3SoundBank *iface, -+ PCSTR szFriendlyName) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ -+ TRACE("(%p)->(%s)\n", This, szFriendlyName); -+ -+ return FACTSoundBank_GetCueIndex(This->fact_soundbank, szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_GetNumCues(IXACT3SoundBank *iface, -+ XACTINDEX *pnNumCues) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pnNumCues); -+ -+ return FACTSoundBank_GetNumCues(This->fact_soundbank, pnNumCues); -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_GetCueProperties(IXACT3SoundBank *iface, -+ XACTINDEX nCueIndex, XACT_CUE_PROPERTIES *pProperties) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ -+ TRACE("(%p)->(%u, %p)\n", This, nCueIndex, pProperties); -+ -+ return FACTSoundBank_GetCueProperties(This->fact_soundbank, nCueIndex, -+ (FACTCueProperties*) pProperties); -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_Prepare(IXACT3SoundBank *iface, -+ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, -+ IXACT3Cue** ppCue) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ XACT3CueImpl *cue; -+ FACTCue *fcue; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%u, 0x%x, %u, %p)\n", This, nCueIndex, dwFlags, timeOffset, -+ ppCue); -+ -+ hr = FACTSoundBank_Prepare(This->fact_soundbank, nCueIndex, dwFlags, -+ timeOffset, &fcue); -+ if(FAILED(hr)) -+ return hr; -+ -+ cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); -+ if (!cue){ -+ FACTCue_Destroy(fcue); -+ ERR("Failed to allocate XACT3CueImpl!"); -+ return hr; -+ } -+ -+ cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl; -+ cue->fact_cue = fcue; -+ *ppCue = (IXACT3Cue*)&cue->IXACT3Cue_iface; -+ -+ TRACE("Created Cue: %p\n", cue); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_Play(IXACT3SoundBank *iface, -+ XACTINDEX nCueIndex, DWORD dwFlags, XACTTIME timeOffset, -+ IXACT3Cue** ppCue) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ XACT3CueImpl *cue; -+ FACTCue *fcue; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%u, 0x%x, %u, %p)\n", This, nCueIndex, dwFlags, timeOffset, -+ ppCue); -+ -+ /* If the application doesn't want a handle, don't generate one at all. -+ * Let the engine handle that memory instead. -+ * -flibit -+ */ -+ if (ppCue == NULL){ -+ hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, -+ timeOffset, NULL); -+ }else{ -+ hr = FACTSoundBank_Play(This->fact_soundbank, nCueIndex, dwFlags, -+ timeOffset, &fcue); -+ if(FAILED(hr)) -+ return hr; -+ -+ cue = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cue)); -+ if (!cue){ -+ FACTCue_Destroy(fcue); -+ ERR("Failed to allocate XACT3CueImpl!"); -+ return hr; -+ } -+ -+ cue->IXACT3Cue_iface.lpVtbl = &XACT3Cue_Vtbl; -+ cue->fact_cue = fcue; -+ *ppCue = (IXACT3Cue*)&cue->IXACT3Cue_iface; -+ } -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_Stop(IXACT3SoundBank *iface, -+ XACTINDEX nCueIndex, DWORD dwFlags) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ -+ TRACE("(%p)->(%u)\n", This, dwFlags); -+ -+ return FACTSoundBank_Stop(This->fact_soundbank, nCueIndex, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_Destroy(IXACT3SoundBank *iface) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)\n", This); -+ -+ hr = FACTSoundBank_Destroy(This->fact_soundbank); -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3SoundBankImpl_GetState(IXACT3SoundBank *iface, -+ DWORD *pdwState) -+{ -+ XACT3SoundBankImpl *This = impl_from_IXACT3SoundBank(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pdwState); -+ -+ return FACTSoundBank_GetState(This->fact_soundbank, pdwState); -+} -+ -+static const IXACT3SoundBankVtbl XACT3SoundBank_Vtbl = -+{ -+ IXACT3SoundBankImpl_GetCueIndex, -+ IXACT3SoundBankImpl_GetNumCues, -+ IXACT3SoundBankImpl_GetCueProperties, -+ IXACT3SoundBankImpl_Prepare, -+ IXACT3SoundBankImpl_Play, -+ IXACT3SoundBankImpl_Stop, -+ IXACT3SoundBankImpl_Destroy, -+ IXACT3SoundBankImpl_GetState -+}; -+ -+static inline XACT3WaveBankImpl *impl_from_IXACT3WaveBank(IXACT3WaveBank *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3WaveBankImpl, IXACT3WaveBank_iface); -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_Destroy(IXACT3WaveBank *iface) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)\n", This); -+ -+ hr = FACTWaveBank_Destroy(This->fact_wavebank); -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_GetNumWaves(IXACT3WaveBank *iface, -+ XACTINDEX *pnNumWaves) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pnNumWaves); -+ -+ return FACTWaveBank_GetNumWaves(This->fact_wavebank, pnNumWaves); -+} -+ -+static XACTINDEX WINAPI IXACT3WaveBankImpl_GetWaveIndex(IXACT3WaveBank *iface, -+ PCSTR szFriendlyName) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ -+ TRACE("(%p)->(%s)\n", This, szFriendlyName); -+ -+ return FACTWaveBank_GetWaveIndex(This->fact_wavebank, szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_GetWaveProperties(IXACT3WaveBank *iface, -+ XACTINDEX nWaveIndex, XACT_WAVE_PROPERTIES *pWaveProperties) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ -+ TRACE("(%p)->(%u, %p)\n", This, nWaveIndex, pWaveProperties); -+ -+ return FACTWaveBank_GetWaveProperties(This->fact_wavebank, nWaveIndex, -+ (FACTWaveProperties*) pWaveProperties); -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_Prepare(IXACT3WaveBank *iface, -+ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, -+ XACTLOOPCOUNT nLoopCount, IXACT3Wave** ppWave) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ XACT3WaveImpl *wave; -+ FACTWave *fwave; -+ HRESULT hr; -+ -+ TRACE("(%p)->(0x%x, %u, 0x%x, %u, %p)\n", This, nWaveIndex, dwFlags, -+ dwPlayOffset, nLoopCount, ppWave); -+ -+ hr = FACTWaveBank_Prepare(This->fact_wavebank, nWaveIndex, dwFlags, -+ dwPlayOffset, nLoopCount, &fwave); -+ if(FAILED(hr)) -+ return hr; -+ -+ wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); -+ if (!wave){ -+ FACTWave_Destroy(fwave); -+ ERR("Failed to allocate XACT3WaveImpl!"); -+ return hr; -+ } -+ -+ wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl; -+ wave->fact_wave = fwave; -+ *ppWave = (IXACT3Wave*)wave; -+ -+ TRACE("Created Wave: %p\n", wave); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_Play(IXACT3WaveBank *iface, -+ XACTINDEX nWaveIndex, DWORD dwFlags, DWORD dwPlayOffset, -+ XACTLOOPCOUNT nLoopCount, IXACT3Wave** ppWave) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ XACT3WaveImpl *wave; -+ FACTWave *fwave; -+ HRESULT hr; -+ -+ TRACE("(%p)->(0x%x, %u, 0x%x, %u, %p)\n", This, nWaveIndex, dwFlags, dwPlayOffset, -+ nLoopCount, ppWave); -+ -+ /* If the application doesn't want a handle, don't generate one at all. -+ * Let the engine handle that memory instead. -+ * -flibit -+ */ -+ if (ppWave == NULL){ -+ hr = FACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, -+ dwPlayOffset, nLoopCount, NULL); -+ }else{ -+ hr = FACTWaveBank_Play(This->fact_wavebank, nWaveIndex, dwFlags, -+ dwPlayOffset, nLoopCount, &fwave); -+ if(FAILED(hr)) -+ return hr; -+ -+ wave = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wave)); -+ if (!wave){ -+ FACTWave_Destroy(fwave); -+ ERR("Failed to allocate XACT3WaveImpl!"); -+ return hr; -+ } -+ -+ wave->IXACT3Wave_iface.lpVtbl = &XACT3Wave_Vtbl; -+ wave->fact_wave = fwave; -+ *ppWave = (IXACT3Wave*)wave; -+ } -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_Stop(IXACT3WaveBank *iface, -+ XACTINDEX nWaveIndex, DWORD dwFlags) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ -+ TRACE("(%p)->(%u, %u)\n", This, nWaveIndex, dwFlags); -+ -+ return FACTWaveBank_Stop(This->fact_wavebank, nWaveIndex, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT3WaveBankImpl_GetState(IXACT3WaveBank *iface, -+ DWORD *pdwState) -+{ -+ XACT3WaveBankImpl *This = impl_from_IXACT3WaveBank(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pdwState); -+ -+ return FACTWaveBank_GetState(This->fact_wavebank, pdwState); -+} -+ -+static const IXACT3WaveBankVtbl XACT3WaveBank_Vtbl = -+{ -+ IXACT3WaveBankImpl_Destroy, -+ IXACT3WaveBankImpl_GetNumWaves, -+ IXACT3WaveBankImpl_GetWaveIndex, -+ IXACT3WaveBankImpl_GetWaveProperties, -+ IXACT3WaveBankImpl_Prepare, -+ IXACT3WaveBankImpl_Play, -+ IXACT3WaveBankImpl_Stop, -+ IXACT3WaveBankImpl_GetState -+}; -+ -+static inline XACT3EngineImpl *impl_from_IXACT3Engine(IXACT3Engine *iface) -+{ -+ return CONTAINING_RECORD(iface, XACT3EngineImpl, IXACT3Engine_iface); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_QueryInterface(IXACT3Engine *iface, -+ REFIID riid, void **ppvObject) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject); -+ -+ if(IsEqualGUID(riid, &IID_IUnknown) || -+ IsEqualGUID(riid, &IID_IXACT3Engine)){ -+ *ppvObject = &This->IXACT3Engine_iface; -+ } -+ else -+ *ppvObject = NULL; -+ -+ if (*ppvObject){ -+ IUnknown_AddRef((IUnknown*)*ppvObject); -+ return S_OK; -+ } -+ -+ FIXME("(%p)->(%s,%p), not found\n", This, debugstr_guid(riid), ppvObject); -+ -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI IXACT3EngineImpl_AddRef(IXACT3Engine *iface) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ ULONG ref = FACTAudioEngine_AddRef(This->fact_engine); -+ TRACE("(%p)->(): Refcount now %u\n", This, ref); -+ return ref; -+} -+ -+static ULONG WINAPI IXACT3EngineImpl_Release(IXACT3Engine *iface) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ ULONG ref = FACTAudioEngine_Release(This->fact_engine); -+ -+ TRACE("(%p)->(): Refcount now %u\n", This, ref); -+ -+ if (!ref) -+ HeapFree(GetProcessHeap(), 0, This); -+ return ref; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_GetRendererCount(IXACT3Engine *iface, -+ XACTINDEX *pnRendererCount) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pnRendererCount); -+ -+ return FACTAudioEngine_GetRendererCount(This->fact_engine, pnRendererCount); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_GetRendererDetails(IXACT3Engine *iface, -+ XACTINDEX nRendererIndex, XACT_RENDERER_DETAILS *pRendererDetails) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%d, %p)\n", This, nRendererIndex, pRendererDetails); -+ -+ return FACTAudioEngine_GetRendererDetails(This->fact_engine, -+ nRendererIndex, (FACTRendererDetails*) pRendererDetails); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_GetFinalMixFormat(IXACT3Engine *iface, -+ WAVEFORMATEXTENSIBLE *pFinalMixFormat) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pFinalMixFormat); -+ -+ return FACTAudioEngine_GetFinalMixFormat(This->fact_engine, -+ (FAudioWaveFormatExtensible*) pFinalMixFormat); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface, -+ const XACT_RUNTIME_PARAMETERS *pParams) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FACTRuntimeParameters params; -+ -+ TRACE("(%p)->(%p)\n", This, pParams); -+ -+ memcpy(¶ms, pParams, sizeof(FACTRuntimeParameters)); -+ -+ /* FIXME: pXAudio2 and pMasteringVoice are pointers to -+ * IXAudio2/IXAudio2MasteringVoice objects. FACT wants pointers to -+ * FAudio/FAudioMasteringVoice objects. In Wine's XAudio2 implementation, we -+ * actually have them available, but only if you access their internal data. -+ * For now we can just force these pointers to NULL, as XACT simply -+ * generates its own engine and endpoint in that situation. These parameters -+ * are mostly an optimization for games with multiple XACT3Engines that want -+ * a single engine running everything. -+ * -flibit -+ */ -+ if (pParams->pXAudio2 != NULL){ -+ FIXME("pXAudio2 parameter not supported! Falling back to NULL\n"); -+ params.pXAudio2 = NULL; -+ -+ if (pParams->pMasteringVoice != NULL){ -+ FIXME("pXAudio2 parameter not supported! Falling back to NULL\n"); -+ params.pMasteringVoice = NULL; -+ } -+ } -+ -+ /* Force Windows I/O, do NOT use the FACT default! */ -+ This->pReadFile = (XACT_READFILE_CALLBACK) -+ pParams->fileIOCallbacks.readFileCallback; -+ This->pGetOverlappedResult = (XACT_GETOVERLAPPEDRESULT_CALLBACK) -+ pParams->fileIOCallbacks.getOverlappedResultCallback; -+ if (This->pReadFile == NULL) -+ This->pReadFile = (XACT_READFILE_CALLBACK) ReadFile; -+ if (This->pGetOverlappedResult == NULL) -+ This->pGetOverlappedResult = (XACT_GETOVERLAPPEDRESULT_CALLBACK) -+ GetOverlappedResult; -+ params.fileIOCallbacks.readFileCallback = wrap_readfile; -+ params.fileIOCallbacks.getOverlappedResultCallback = wrap_getoverlappedresult; -+ -+ return FACTAudioEngine_Initialize(This->fact_engine, ¶ms); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_ShutDown(IXACT3Engine *iface) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)\n", This); -+ -+ return FACTAudioEngine_ShutDown(This->fact_engine); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_DoWork(IXACT3Engine *iface) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)\n", This); -+ -+ return FACTAudioEngine_DoWork(This->fact_engine); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, -+ const void* pvBuffer, DWORD dwSize, DWORD dwFlags, -+ DWORD dwAllocAttributes, IXACT3SoundBank **ppSoundBank) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ XACT3SoundBankImpl *sb; -+ FACTSoundBank *fsb; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags, -+ dwAllocAttributes, ppSoundBank); -+ -+ hr = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize, -+ dwFlags, dwAllocAttributes, &fsb); -+ if(FAILED(hr)) -+ return hr; -+ -+ sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sb)); -+ if (!sb){ -+ FACTSoundBank_Destroy(fsb); -+ ERR("Failed to allocate XACT3SoundBankImpl!"); -+ return hr; -+ } -+ -+ sb->IXACT3SoundBank_iface.lpVtbl = &XACT3SoundBank_Vtbl; -+ sb->fact_soundbank = fsb; -+ *ppSoundBank = (IXACT3SoundBank*)sb; -+ -+ TRACE("Created SoundBank: %p\n", sb); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *iface, -+ const void* pvBuffer, DWORD dwSize, DWORD dwFlags, -+ DWORD dwAllocAttributes, IXACT3WaveBank **ppWaveBank) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ XACT3WaveBankImpl *wb; -+ FACTWaveBank *fwb; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags, -+ dwAllocAttributes, ppWaveBank); -+ -+ hr = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer, -+ dwSize, dwFlags, dwAllocAttributes, &fwb); -+ if(FAILED(hr)) -+ return hr; -+ -+ wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); -+ if (!wb){ -+ FACTWaveBank_Destroy(fwb); -+ ERR("Failed to allocate XACT3WaveBankImpl!"); -+ return hr; -+ } -+ -+ wb->IXACT3WaveBank_iface.lpVtbl = &XACT3WaveBank_Vtbl; -+ wb->fact_wavebank = fwb; -+ *ppWaveBank = (IXACT3WaveBank*)wb; -+ -+ TRACE("Created in-memory WaveBank: %p\n", wb); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *iface, -+ const XACT_STREAMING_PARAMETERS *pParms, -+ IXACT3WaveBank **ppWaveBank) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FACTStreamingParameters fakeParms; -+ wrap_readfile_struct *fake; -+ XACT3WaveBankImpl *wb; -+ FACTWaveBank *fwb; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p, %p)\n", This, pParms, ppWaveBank); -+ -+ /* We have to wrap the file to fix up the callbacks! */ -+ fake = (wrap_readfile_struct*) CoTaskMemAlloc( -+ sizeof(wrap_readfile_struct)); -+ fake->engine = This; -+ fake->file = pParms->file; -+ fakeParms.file = fake; -+ fakeParms.flags = pParms->flags; -+ fakeParms.offset = pParms->offset; -+ fakeParms.packetSize = pParms->packetSize; -+ -+ hr = FACTAudioEngine_CreateStreamingWaveBank(This->fact_engine, &fakeParms, -+ &fwb); -+ if(FAILED(hr)) -+ return hr; -+ -+ wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); -+ if (!wb){ -+ FACTWaveBank_Destroy(fwb); -+ ERR("Failed to allocate XACT3WaveBankImpl!"); -+ return hr; -+ } -+ -+ wb->IXACT3WaveBank_iface.lpVtbl = &XACT3WaveBank_Vtbl; -+ wb->fact_wavebank = fwb; -+ *ppWaveBank = (IXACT3WaveBank*)wb; -+ -+ TRACE("Created streaming WaveBank: %p\n", wb); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_PrepareWave(IXACT3Engine *iface, -+ DWORD dwFlags, PCSTR szWavePath, WORD wStreamingPacketSize, -+ DWORD dwAlignment, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, -+ IXACT3Wave **ppWave) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FIXME("(%p): stub!\n", This); -+ return S_OK; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_PrepareInMemoryWave(IXACT3Engine *iface, -+ DWORD dwFlags, WAVEBANKENTRY entry, DWORD *pdwSeekTable, -+ BYTE *pbWaveData, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, -+ IXACT3Wave **ppWave) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FIXME("(%p): stub!\n", This); -+ return S_OK; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_PrepareStreamingWave(IXACT3Engine *iface, -+ DWORD dwFlags, WAVEBANKENTRY entry, -+ XACT_STREAMING_PARAMETERS streamingParams, DWORD dwAlignment, -+ DWORD *pdwSeekTable, DWORD dwPlayOffset, XACTLOOPCOUNT nLoopCount, -+ IXACT3Wave **ppWave) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FIXME("(%p): stub!\n", This); -+ return S_OK; -+} -+ -+static inline void unwrap_notificationdesc(FACTNotificationDescription *fd, -+ const XACT_NOTIFICATION_DESCRIPTION *xd) -+{ -+ /* We have to unwrap the FACT object first! */ -+ fd->type = xd->type; -+ fd->flags = xd->flags; -+ fd->cueIndex = xd->cueIndex; -+ fd->waveIndex = xd->waveIndex; -+ fd->pvContext = xd->pvContext; -+ -+ if (xd->pCue != NULL) -+ fd->pCue = ((XACT3CueImpl*) xd->pCue)->fact_cue; -+ else -+ fd->pCue = NULL; -+ -+ if (xd->pSoundBank != NULL) -+ fd->pSoundBank = ((XACT3SoundBankImpl*) xd->pSoundBank)->fact_soundbank; -+ else -+ fd->pSoundBank = NULL; -+ -+ if (xd->pWaveBank != NULL) -+ fd->pWaveBank = ((XACT3WaveBankImpl*) xd->pWaveBank)->fact_wavebank; -+ else -+ fd->pWaveBank = NULL; -+ -+ if (xd->pWave != NULL) -+ fd->pWave = ((XACT3WaveImpl*) xd->pWave)->fact_wave; -+ else -+ fd->pWave = NULL; -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface, -+ const XACT_NOTIFICATION_DESCRIPTION *pNotificationDesc) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FACTNotificationDescription fdesc; -+ -+ TRACE("(%p)->(%p)\n", This, pNotificationDesc); -+ -+ unwrap_notificationdesc(&fdesc, pNotificationDesc); -+ return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *iface, -+ const XACT_NOTIFICATION_DESCRIPTION *pNotificationDesc) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ FACTNotificationDescription fdesc; -+ -+ TRACE("(%p)->(%p)\n", This, pNotificationDesc); -+ -+ unwrap_notificationdesc(&fdesc, pNotificationDesc); -+ return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); -+} -+ -+static XACTCATEGORY WINAPI IXACT3EngineImpl_GetCategory(IXACT3Engine *iface, -+ PCSTR szFriendlyName) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%s)\n", This, szFriendlyName); -+ -+ return FACTAudioEngine_GetCategory(This->fact_engine, szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_Stop(IXACT3Engine *iface, -+ XACTCATEGORY nCategory, DWORD dwFlags) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%u, 0x%x)\n", This, nCategory, dwFlags); -+ -+ return FACTAudioEngine_Stop(This->fact_engine, nCategory, dwFlags); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_SetVolume(IXACT3Engine *iface, -+ XACTCATEGORY nCategory, XACTVOLUME nVolume) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%u, %f)\n", This, nCategory, nVolume); -+ -+ return FACTAudioEngine_SetVolume(This->fact_engine, nCategory, nVolume); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_Pause(IXACT3Engine *iface, -+ XACTCATEGORY nCategory, BOOL fPause) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%u, %u)\n", This, nCategory, fPause); -+ -+ return FACTAudioEngine_Pause(This->fact_engine, nCategory, fPause); -+} -+ -+static XACTVARIABLEINDEX WINAPI IXACT3EngineImpl_GetGlobalVariableIndex( -+ IXACT3Engine *iface, PCSTR szFriendlyName) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%s)\n", This, szFriendlyName); -+ -+ return FACTAudioEngine_GetGlobalVariableIndex(This->fact_engine, -+ szFriendlyName); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_SetGlobalVariable(IXACT3Engine *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE nValue) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%u, %f)\n", This, nIndex, nValue); -+ -+ return FACTAudioEngine_SetGlobalVariable(This->fact_engine, nIndex, nValue); -+} -+ -+static HRESULT WINAPI IXACT3EngineImpl_GetGlobalVariable(IXACT3Engine *iface, -+ XACTVARIABLEINDEX nIndex, XACTVARIABLEVALUE *nValue) -+{ -+ XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); -+ -+ TRACE("(%p)->(%u, %p)\n", This, nIndex, nValue); -+ -+ return FACTAudioEngine_GetGlobalVariable(This->fact_engine, nIndex, nValue); -+} -+ -+static const IXACT3EngineVtbl XACT3Engine_Vtbl = -+{ -+ IXACT3EngineImpl_QueryInterface, -+ IXACT3EngineImpl_AddRef, -+ IXACT3EngineImpl_Release, -+ IXACT3EngineImpl_GetRendererCount, -+ IXACT3EngineImpl_GetRendererDetails, -+ IXACT3EngineImpl_GetFinalMixFormat, -+ IXACT3EngineImpl_Initialize, -+ IXACT3EngineImpl_ShutDown, -+ IXACT3EngineImpl_DoWork, -+ IXACT3EngineImpl_CreateSoundBank, -+ IXACT3EngineImpl_CreateInMemoryWaveBank, -+ IXACT3EngineImpl_CreateStreamingWaveBank, -+ IXACT3EngineImpl_PrepareWave, -+ IXACT3EngineImpl_PrepareInMemoryWave, -+ IXACT3EngineImpl_PrepareStreamingWave, -+ IXACT3EngineImpl_RegisterNotification, -+ IXACT3EngineImpl_UnRegisterNotification, -+ IXACT3EngineImpl_GetCategory, -+ IXACT3EngineImpl_Stop, -+ IXACT3EngineImpl_SetVolume, -+ IXACT3EngineImpl_Pause, -+ IXACT3EngineImpl_GetGlobalVariableIndex, -+ IXACT3EngineImpl_SetGlobalVariable, -+ IXACT3EngineImpl_GetGlobalVariable -+}; -+ -+static HRESULT WINAPI XACT3CF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) -+{ -+ if(IsEqualGUID(riid, &IID_IUnknown) || -+ IsEqualGUID(riid, &IID_IClassFactory)) -+ { -+ *ppobj = iface; -+ return S_OK; -+ } -+ -+ *ppobj = NULL; -+ WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI XACT3CF_AddRef(IClassFactory *iface) -+{ -+ return 2; -+} -+ -+static ULONG WINAPI XACT3CF_Release(IClassFactory *iface) -+{ -+ return 1; -+} -+ -+static HRESULT WINAPI XACT3CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, -+ REFIID riid, void **ppobj) -+{ -+ HRESULT hr; -+ XACT3EngineImpl *object; -+ -+ TRACE("(%p)->(%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid), ppobj); -+ -+ *ppobj = NULL; -+ -+ if(pOuter) -+ return CLASS_E_NOAGGREGATION; -+ -+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); -+ if(!object) -+ return E_OUTOFMEMORY; -+ -+ object->IXACT3Engine_iface.lpVtbl = &XACT3Engine_Vtbl; -+ -+ FACTCreateEngineWithCustomAllocatorEXT( -+ 0, -+ &object->fact_engine, -+ XAudio_Internal_Malloc, -+ XAudio_Internal_Free, -+ XAudio_Internal_Realloc -+ ); -+ -+ hr = IXACT3Engine_QueryInterface(&object->IXACT3Engine_iface, riid, ppobj); -+ if(FAILED(hr)){ -+ HeapFree(GetProcessHeap(), 0, object); -+ return hr; -+ } -+ -+ TRACE("Created XACT version 0x%04x: %p\n", XACT3_VER, object); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI XACT3CF_LockServer(IClassFactory *iface, BOOL dolock) -+{ -+ TRACE("(%p)->(%d): stub!\n", iface, dolock); -+ return S_OK; -+} -+ -+static const IClassFactoryVtbl XACT3CF_Vtbl = -+{ -+ XACT3CF_QueryInterface, -+ XACT3CF_AddRef, -+ XACT3CF_Release, -+ XACT3CF_CreateInstance, -+ XACT3CF_LockServer -+}; -+ -+static IClassFactory XACTFactory = { &XACT3CF_Vtbl }; -+ -+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) -+{ -+ TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); -+ -+#if XACT3_VER == 0x0300 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine30)) -+#elif XACT3_VER == 0x0301 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine31)) -+#elif XACT3_VER == 0x0302 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine32)) -+#elif XACT3_VER == 0x0303 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine33)) -+#elif XACT3_VER == 0x0304 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine34)) -+#elif XACT3_VER == 0x0305 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine35)) -+#elif XACT3_VER == 0x0306 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine36)) -+#elif XACT3_VER == 0x0307 -+ if (IsEqualGUID(rclsid, &CLSID_XACTEngine37)) -+#endif -+ return IClassFactory_QueryInterface(&XACTFactory, riid, ppv); -+ -+ return CLASS_E_CLASSNOTAVAILABLE; -+} -+ -+#endif --- -2.27.0 - diff --git a/patches/xactengine-initial/0003-xaudio2_7-Support-older-XACT3Engine-interfaces.patch b/patches/xactengine-initial/0003-xaudio2_7-Support-older-XACT3Engine-interfaces.patch deleted file mode 100644 index 7bc12d80..00000000 --- a/patches/xactengine-initial/0003-xaudio2_7-Support-older-XACT3Engine-interfaces.patch +++ /dev/null @@ -1,41 +0,0 @@ -From c7189e9d48079b0f3993ed8de8f774f3e0a7a97e Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Tue, 7 Jan 2020 22:14:49 +1100 -Subject: [PATCH] xaudio2_7: Support older XACT3Engine interfaces - ---- - dlls/xaudio2_7/xact_dll.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c -index 07f866606d..91e3ef0afd 100644 ---- a/dlls/xaudio2_7/xact_dll.c -+++ b/dlls/xaudio2_7/xact_dll.c -@@ -39,6 +39,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(xact3); - - static HINSTANCE instance; - -+#if XACT3_VER >= 0x0301 && XACT3_VER <= 0x304 -+DEFINE_GUID(IID_IXACT3Engine301, 0xe72c1b9a, 0xd717, 0x41c0, 0x81, 0xa6, 0x50, 0xeb, 0x56, 0xe8, 0x06, 0x49); -+#endif -+ - BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved) - { - TRACE("(%p, %d, %p)\n", hinstDLL, reason, pReserved); -@@ -852,7 +856,12 @@ static HRESULT WINAPI IXACT3EngineImpl_QueryInterface(IXACT3Engine *iface, - TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject); - - if(IsEqualGUID(riid, &IID_IUnknown) || -- IsEqualGUID(riid, &IID_IXACT3Engine)){ -+#if XACT3_VER >= 0x0301 && XACT3_VER <= 0x304 -+ IsEqualGUID(riid, &IID_IXACT3Engine301) -+#else -+ IsEqualGUID(riid, &IID_IXACT3Engine) -+#endif -+ ){ - *ppvObject = &This->IXACT3Engine_iface; - } - else --- -2.25.1 - diff --git a/patches/xactengine-initial/0005-xaudio2_7-IXACT3Engine-CreateSoundBank-return-correc.patch b/patches/xactengine-initial/0005-xaudio2_7-IXACT3Engine-CreateSoundBank-return-correc.patch deleted file mode 100644 index 04034d67..00000000 --- a/patches/xactengine-initial/0005-xaudio2_7-IXACT3Engine-CreateSoundBank-return-correc.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 2335980b1a1e36ce475a99b08498747021b5284c Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Wed, 8 Jan 2020 10:39:02 +1100 -Subject: [PATCH] xaudio2_7: IXACT3Engine CreateSoundBank return correct - HRESULT values. - ---- - dlls/xaudio2_7/xact_dll.c | 28 ++++++++++++++++------------ - 1 file changed, 16 insertions(+), 12 deletions(-) - -diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c -index 1f580519d4..9cec216002 100644 ---- a/dlls/xaudio2_7/xact_dll.c -+++ b/dlls/xaudio2_7/xact_dll.c -@@ -1005,21 +1005,23 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, - XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); - XACT3SoundBankImpl *sb; - FACTSoundBank *fsb; -- HRESULT hr; -+ UINT ret; - - TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags, - dwAllocAttributes, ppSoundBank); - -- hr = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize, -+ ret = FACTAudioEngine_CreateSoundBank(This->fact_engine, pvBuffer, dwSize, - dwFlags, dwAllocAttributes, &fsb); -- if(FAILED(hr)) -- return hr; -+ if (ret != 0) { -+ ERR("Failed to CreateSoundBank: %d\n", ret); -+ return E_FAIL; -+ } - - sb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sb)); - if (!sb){ - FACTSoundBank_Destroy(fsb); - ERR("Failed to allocate XACT3SoundBankImpl!"); -- return hr; -+ return E_OUTOFMEMORY; - } - - sb->IXACT3SoundBank_iface.lpVtbl = &XACT3SoundBank_Vtbl; -@@ -1028,7 +1030,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateSoundBank(IXACT3Engine *iface, - - TRACE("Created SoundBank: %p\n", sb); - -- return hr; -+ return S_OK; - } - - static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *iface, -@@ -1038,21 +1040,23 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac - XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); - XACT3WaveBankImpl *wb; - FACTWaveBank *fwb; -- HRESULT hr; -+ UINT ret; - - TRACE("(%p)->(%p, %u, 0x%x, 0x%x, %p)\n", This, pvBuffer, dwSize, dwFlags, - dwAllocAttributes, ppWaveBank); - -- hr = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer, -+ ret = FACTAudioEngine_CreateInMemoryWaveBank(This->fact_engine, pvBuffer, - dwSize, dwFlags, dwAllocAttributes, &fwb); -- if(FAILED(hr)) -- return hr; -+ if (ret != 0) { -+ ERR("Failed to CreateInMemoryWaveBank: %d\n", ret); -+ return E_FAIL; -+ } - - wb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*wb)); - if (!wb){ - FACTWaveBank_Destroy(fwb); - ERR("Failed to allocate XACT3WaveBankImpl!"); -- return hr; -+ return E_OUTOFMEMORY; - } - - wb->IXACT3WaveBank_iface.lpVtbl = &XACT3WaveBank_Vtbl; -@@ -1061,7 +1065,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateInMemoryWaveBank(IXACT3Engine *ifac - - TRACE("Created in-memory WaveBank: %p\n", wb); - -- return hr; -+ return S_OK; - } - - static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *iface, --- -2.25.1 - diff --git a/patches/xactengine-initial/0009-xaudio2_7-unwrap-structure-based-of-it-s-type.patch b/patches/xactengine-initial/0009-xaudio2_7-unwrap-structure-based-of-it-s-type.patch deleted file mode 100644 index 0445a67d..00000000 --- a/patches/xactengine-initial/0009-xaudio2_7-unwrap-structure-based-of-it-s-type.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 25c1fa51fd49839fe0858493537c1c3c7cdfea30 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Thu, 9 Jan 2020 09:06:01 +1100 -Subject: [PATCH] xaudio2_7: unwrap structure based of it's type. - ---- - dlls/xaudio2_7/xact_dll.c | 54 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 47 insertions(+), 7 deletions(-) - -diff --git a/dlls/xaudio2_7/xact_dll.c b/dlls/xaudio2_7/xact_dll.c -index b089f71d4ac..252c44767db 100644 ---- a/dlls/xaudio2_7/xact_dll.c -+++ b/dlls/xaudio2_7/xact_dll.c -@@ -1144,42 +1144,82 @@ static HRESULT WINAPI IXACT3EngineImpl_PrepareStreamingWave(IXACT3Engine *iface, - return S_OK; - } - -+enum { NOTIFY_SoundBank = 0x01, -+ NOTIFY_WaveBank = 0x02, -+ NOTIFY_Cue = 0x04, -+ NOTIFY_Wave = 0x08, -+ NOTIFY_cueIndex = 0x10, -+ NOTIFY_waveIndex = 0x20 }; -+ - static inline void unwrap_notificationdesc(FACTNotificationDescription *fd, - const XACT_NOTIFICATION_DESCRIPTION *xd) - { -+ DWORD flags = 0; - memset(fd, 0, sizeof(*fd)); - /* We have to unwrap the FACT object first! */ - -- FIXME("Type %d\n", xd->type); -+ TRACE("Type %d\n", xd->type); -+ /* Supports SoundBank, Cue index, Cue instance */ -+ if (xd->type == XACTNOTIFICATIONTYPE_CUEPREPARED || xd->type == XACTNOTIFICATIONTYPE_CUEPLAY || -+ xd->type == XACTNOTIFICATIONTYPE_CUESTOP || xd->type == XACTNOTIFICATIONTYPE_CUEDESTROYED || -+ xd->type == XACTNOTIFICATIONTYPE_MARKER || xd->type == XACTNOTIFICATIONTYPE_LOCALVARIABLECHANGED) -+ { -+ flags = NOTIFY_SoundBank | NOTIFY_cueIndex | NOTIFY_Cue; -+ } -+ /* Supports WaveBank */ -+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEBANKDESTROYED || xd->type == XACTNOTIFICATIONTYPE_WAVEBANKPREPARED || -+ xd->type == XACTNOTIFICATIONTYPE_WAVEBANKSTREAMING_INVALIDCONTENT) -+ { -+ flags = NOTIFY_WaveBank; -+ } -+ /* Supports NOTIFY_SoundBank */ -+ else if (xd->type == XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED) -+ { -+ flags = NOTIFY_SoundBank; -+ } -+ /* Supports WaveBank, Wave index, Wave instance */ -+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEPREPARED || xd->type == XACTNOTIFICATIONTYPE_WAVEDESTROYED) -+ { -+ flags = NOTIFY_WaveBank | NOTIFY_waveIndex | NOTIFY_Wave; -+ } -+ /* Supports SoundBank, SoundBank, Cue index, Cue instance, WaveBank, Wave instance */ -+ else if (xd->type == XACTNOTIFICATIONTYPE_WAVEPLAY || xd->type == XACTNOTIFICATIONTYPE_WAVESTOP || -+ xd->type == XACTNOTIFICATIONTYPE_WAVELOOPED) -+ { -+ flags = NOTIFY_SoundBank | NOTIFY_cueIndex | NOTIFY_Cue | NOTIFY_WaveBank | NOTIFY_Wave; -+ } - - fd->type = xd->type; - fd->flags = xd->flags; -- fd->cueIndex = xd->cueIndex; -- fd->waveIndex = xd->waveIndex; - fd->pvContext = xd->pvContext; - -- if (xd->pCue != NULL) -+ if (flags & NOTIFY_cueIndex) -+ fd->cueIndex = xd->cueIndex; -+ if (flags & NOTIFY_waveIndex) -+ fd->waveIndex = xd->waveIndex; -+ -+ if (flags & NOTIFY_Cue && xd->pCue != NULL) - { - XACT3CueImpl *cur = impl_from_IXACT3Cue(xd->pCue); - if (cur) - fd->pCue = cur->fact_cue; - } - -- if (xd->pSoundBank != NULL) -+ if (flags & NOTIFY_SoundBank && xd->pSoundBank != NULL) - { - XACT3SoundBankImpl *sound = impl_from_IXACT3SoundBank(xd->pSoundBank); - if (sound) - fd->pSoundBank = sound->fact_soundbank; - } - -- if (xd->pWaveBank != NULL) -+ if (flags & NOTIFY_WaveBank && xd->pWaveBank != NULL) - { - XACT3WaveBankImpl *bank = impl_from_IXACT3WaveBank(xd->pWaveBank); - if (bank) - fd->pWaveBank = bank->fact_wavebank; - } - -- if (xd->pWave != NULL) -+ if (flags & NOTIFY_Wave && xd->pWave != NULL) - { - XACT3WaveImpl *wave = impl_from_IXACT3Wave(xd->pWave); - FIXME("Wave %p\n", wave); --- -2.25.1 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 5cfd369e..f0e383b0 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -f7895ef25a4cb2115ffbe04d28b87bcb6ee3c0b7 +8cbbb4f394678411fdb57237553f5d974527877f