[PATCH] align stack to 4 byte.

Marcus Meissner marcus at jet.franken.de
Wed Sep 27 15:10:16 CDT 2006


RawShooter Premiums copy protection enters 
the signal handler with an unaligned stack,
and (I think) the unaligned fault handler / flag

Just aligning the stack makes it go further (and crash
my X server, but thats the next problem).

I wonder if this is the right way. Or if to 4 byte
is sufficient.

The other exceptions seem to still work fine.

Ciao, Marcus

 dlls/ntdll/signal_i386.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 44f47ec..bb74777 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -525,6 +525,8 @@ inline static void *init_handler( const 
     TEB *teb = get_current_teb();
     struct ntdll_thread_regs *thread_regs = (struct ntdll_thread_regs *)teb->SpareBytes1;
+    stack = (void*)(((unsigned long)stack)&~3);
     /* get %fs and %gs at time of the fault */
 #ifdef FS_sig
     *fs = LOWORD(FS_sig(sigcontext));

More information about the wine-patches mailing list