From 5106ee4a5d57fa44a7972a63b7738a33ad2bff66 Mon Sep 17 00:00:00 2001 From: Markus Amsler Date: Mon, 18 Oct 2004 21:19:57 +0000 Subject: [PATCH] Initialize .COM stack. --- dlls/winedos/module.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index c3b10c1152c..63dac076490 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -315,6 +315,11 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk ) init_ip = mz_header.e_ip; init_ss = load_seg+mz_header.e_ss; init_sp = mz_header.e_sp; + if (old_com){ + /* .COM files exit with ret. Make sure they jump to psp start (=int 20) */ + WORD* stack = PTR_REAL_TO_LIN(init_ss, init_sp); + *stack = 0; + } TRACE("entry point: %04x:%04x\n",init_cs,init_ip); }