Fix EXEC function 01 (load but don't execute): initial ax has to be on

child's stack.
oldstable
Markus Amsler 2004-08-09 23:39:40 +00:00 committed by Alexandre Julliard
parent 448dc4fa1e
commit bd97e85922
1 changed files with 12 additions and 0 deletions

View File

@ -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;