From a2fe8ebe3ce8d3d54d0bf393319962acf0c95501 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 24 Nov 1998 20:44:46 +0000 Subject: [PATCH] Bugfix: [QF]T_Thunk should clear HIWORD(EAX) on return. Bugfix: hack for stupid USER32 CallbackGlueLS routine in Common32ThkLS. --- win32/kernel32.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/win32/kernel32.c b/win32/kernel32.c index 4973b8ff58..b90a01a458 100644 --- a/win32/kernel32.c +++ b/win32/kernel32.c @@ -263,6 +263,7 @@ REGS_ENTRYPOINT(QT_Thunk) EAX_reg(context) = Callbacks->CallRegisterShortProc( &context16, argsize ); EDX_reg(context) = HIWORD(EAX_reg(context)); + EAX_reg(context) = LOWORD(EAX_reg(context)); } @@ -392,6 +393,7 @@ REGS_ENTRYPOINT(FT_Thunk) EAX_reg(context) = Callbacks->CallRegisterShortProc( &context16, argsize ); EDX_reg(context) = HIWORD(EAX_reg(context)); + EAX_reg(context) = LOWORD(EAX_reg(context)); } /********************************************************************** @@ -565,6 +567,10 @@ REGS_ENTRYPOINT(Common32ThkLS) argsize = HIWORD(EDX_reg(context)) * 4; + /* FIXME: hack for stupid USER32 CallbackGlueLS routine */ + if (EDX_reg(context) == EIP_reg(context)) + argsize = 6 * 4; + memcpy( ((LPBYTE)THREAD_STACK16(thdb))-argsize, (LPBYTE)ESP_reg(context)+4, argsize );