Added patch to use assembly wrapper to call OnVoiceProcessingPassStart callback.

This commit is contained in:
Sebastian Lackner 2017-07-15 22:24:41 +02:00
parent b8ffc62855
commit 020888539d
3 changed files with 83 additions and 0 deletions

View File

@ -493,6 +493,7 @@ patch_enable_all ()
enable_wuauserv_Dummy_Service="$1"
enable_wusa_MSU_Package_Installer="$1"
enable_xaudio2_get_al_format="$1"
enable_xaudio2_7_OnVoiceProcessingPassStart="$1"
enable_xinput9_1_0_Parentsrc="$1"
}
@ -1733,6 +1734,9 @@ patch_enable ()
xaudio2-get_al_format)
enable_xaudio2_get_al_format="$2"
;;
xaudio2_7-OnVoiceProcessingPassStart)
enable_xaudio2_7_OnVoiceProcessingPassStart="$2"
;;
xinput9_1_0-Parentsrc)
enable_xinput9_1_0_Parentsrc="$2"
;;
@ -10050,6 +10054,21 @@ if test "$enable_xaudio2_get_al_format" -eq 1; then
) >> "$patchlist"
fi
# Patchset xaudio2_7-OnVoiceProcessingPassStart
# |
# | This patchset fixes the following Wine bugs:
# | * [#43358] Use assembly wrapper to call OnVoiceProcessingPassStart callback
# |
# | Modified files:
# | * dlls/xaudio2_7/xaudio_dll.c
# |
if test "$enable_xaudio2_7_OnVoiceProcessingPassStart" -eq 1; then
patch_apply xaudio2_7-OnVoiceProcessingPassStart/0001-xaudio2_7-Use-assembly-wrapper-to-call-OnVoiceProces.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "xaudio2_7: Use assembly wrapper to call OnVoiceProcessingPassStart callback.", 1 },';
) >> "$patchlist"
fi
# Patchset xinput9_1_0-Parentsrc
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,63 @@
From af47a9365411f0b25cd54ad38d152fe4878da10f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Jul 2017 22:20:28 +0200
Subject: xaudio2_7: Use assembly wrapper to call OnVoiceProcessingPassStart
callback.
---
dlls/xaudio2_7/xaudio_dll.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c
index 13f591630fd..5770a99b44c 100644
--- a/dlls/xaudio2_7/xaudio_dll.c
+++ b/dlls/xaudio2_7/xaudio_dll.c
@@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
#include <stdarg.h>
#define NONAMELESSUNION
@@ -50,6 +51,37 @@ static HINSTANCE instance;
#define COMPAT_E_DEVICE_INVALIDATED XAUDIO2_E_DEVICE_INVALIDATED
#endif
+#if XAUDIO2_VER != 0 && defined(__i386__)
+/* EVE Online uses an OnVoiceProcessingPassStart callback which corrupts %esi. */
+#define IXAudio2VoiceCallback_OnVoiceProcessingPassStart(a, b) call_on_voice_processing_pass_start(a, b)
+extern void call_on_voice_processing_pass_start(IXAudio2VoiceCallback *This, UINT32 BytesRequired);
+__ASM_GLOBAL_FUNC( call_on_voice_processing_pass_start,
+ "pushl %ebp\n\t"
+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
+ "movl %esp,%ebp\n\t"
+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
+ "pushl %esi\n\t"
+ __ASM_CFI(".cfi_rel_offset %esi,-4\n\t")
+ "pushl %edi\n\t"
+ __ASM_CFI(".cfi_rel_offset %edi,-8\n\t")
+ "subl $8,%esp\n\t"
+ "pushl 12(%ebp)\n\t" /* BytesRequired */
+ "pushl 8(%ebp)\n\t" /* This */
+ "movl 8(%ebp),%eax\n\t"
+ "movl 0(%eax),%eax\n\t"
+ "call *0(%eax)\n\t" /* This->lpVtbl->OnVoiceProcessingPassStart */
+ "leal -8(%ebp),%esp\n\t"
+ "popl %edi\n\t"
+ __ASM_CFI(".cfi_same_value %edi\n\t")
+ "popl %esi\n\t"
+ __ASM_CFI(".cfi_same_value %esi\n\t")
+ "popl %ebp\n\t"
+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
+ __ASM_CFI(".cfi_same_value %ebp\n\t")
+ "ret" )
+#endif
+
static void dump_fmt(const WAVEFORMATEX *fmt)
{
TRACE("wFormatTag: 0x%x (", fmt->wFormatTag);
--
2.13.1

View File

@ -0,0 +1 @@
Fixes: [43358] Use assembly wrapper to call OnVoiceProcessingPassStart callback