From bd97e8592228b969e028018337050c243303a9b0 Mon Sep 17 00:00:00 2001 From: Markus Amsler Date: Mon, 9 Aug 2004 23:39:40 +0000 Subject: [PATCH] Fix EXEC function 01 (load but don't execute): initial ax has to be on child's stack. --- dlls/winedos/module.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index dc04d2e10a8..c297c53584b 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -511,6 +511,18 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para DOSVM_SetRMHandler(0x22, (FARPROC16)MAKESEGPTR(context->SegCs, LOWORD(context->Eip))); if (func) { /* don't execute, just return startup state */ + /* + * From Ralph Brown: + * For function 01h, the AX value to be passed to the child program + * is put on top of the child's stack + */ + LPBYTE stack; + init_sp -= 2; + stack = (LPBYTE) CTX_SEG_OFF_TO_LIN(context, init_ss, init_sp); + /* FIXME: push AX correctly */ + stack[0] = 0x00; /* push AL */ + stack[1] = 0x00; /* push AH */ + blk->init_cs = init_cs; blk->init_ip = init_ip; blk->init_ss = init_ss;