Added patch to fill stack with meaningful values in call_process_entry mis-align workaround.

This commit is contained in:
Sebastian Lackner 2016-05-01 16:46:46 +02:00
parent b71dcee6b2
commit fa8670d547
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From 46302575f68264f8b097a663bee06e8624fa69ad Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 1 May 2016 16:45:31 +0200
Subject: kernel32: Fill stack with meaningful values in call_process_entry
mis-align workaround.
---
dlls/kernel32/process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 4771108..28ec659 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -1064,7 +1064,9 @@ __ASM_GLOBAL_FUNC( call_process_entry,
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
"movl %esp,%ebp\n\t"
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
- "subl $12,%esp\n\t" /* deliberately mis-align the stack by 8, Doom 3 needs this */
+ "pushl 4(%ebp)\n\t" /* deliberately mis-align the stack by 8, Doom 3 needs this */
+ "pushl 4(%ebp)\n\t" /* Driller expects readable address at this offset */
+ "pushl 4(%ebp)\n\t"
"pushl 8(%ebp)\n\t"
"call *12(%ebp)\n\t"
"leave\n\t"
--
2.8.0

View File

@ -0,0 +1 @@
Fixes: [24374] Fill stack with meaningful values in call_process_entry mis-align workaround

View File

@ -169,6 +169,7 @@ patch_enable_all ()
enable_kernel32_GetCurrentPackageFamilyName="$1"
enable_kernel32_GetShortPathName="$1"
enable_kernel32_LocaleNameToLCID="$1"
enable_kernel32_Misalign_Workaround="$1"
enable_kernel32_Named_Pipe="$1"
enable_kernel32_NeedCurrentDirectoryForExePath="$1"
enable_kernel32_Profile="$1"
@ -676,6 +677,9 @@ patch_enable ()
kernel32-LocaleNameToLCID)
enable_kernel32_LocaleNameToLCID="$2"
;;
kernel32-Misalign_Workaround)
enable_kernel32_Misalign_Workaround="$2"
;;
kernel32-Named_Pipe)
enable_kernel32_Named_Pipe="$2"
;;
@ -3999,6 +4003,21 @@ if test "$enable_kernel32_LocaleNameToLCID" -eq 1; then
) >> "$patchlist"
fi
# Patchset kernel32-Misalign_Workaround
# |
# | This patchset fixes the following Wine bugs:
# | * [#24374] Fill stack with meaningful values in call_process_entry mis-align workaround
# |
# | Modified files:
# | * dlls/kernel32/process.c
# |
if test "$enable_kernel32_Misalign_Workaround" -eq 1; then
patch_apply kernel32-Misalign_Workaround/0001-kernel32-Fill-stack-with-meaningful-values-in-call_p.patch
(
echo '+ { "Sebastian Lackner", "kernel32: Fill stack with meaningful values in call_process_entry mis-align workaround.", 1 },';
) >> "$patchlist"
fi
# Patchset rpcrt4-Pipe_Transport
# |
# | Modified files: