[PATCH] winedbg: Avoid truncating a 32 bit exception code as exit code

Martin Storsjo martin at martin.st
Fri May 10 15:20:38 CDT 2019


On unix, traditionally only the lower 8 bits of the exit code
are returned. In case ExceptionCode is EXCEPTION_WINE_STUB,
80000100, the observed exit code outside is zero, which would
indicate successful execution.

Therefore, just return a one, instead of trying to pass on the
whole exception code, of which only a quarter is returned on unix.

Signed-off-by: Martin Storsjo <martin at martin.st>
---
 programs/winedbg/tgt_active.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index 5385d0effa..0a4453f8d6 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -977,7 +977,7 @@ static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill)
         DWORD exit_code = 0;
 
         if (pcs == dbg_curr_process && dbg_curr_thread->in_exception)
-            exit_code = dbg_curr_thread->excpt_record.ExceptionCode;
+            exit_code = 1;
 
         TerminateProcess(pcs->handle, exit_code);
     }
-- 
2.17.1




More information about the wine-devel mailing list