This patch prepares the floor for the moving of funcitons of int21 to winedos. ChangeLog: * dlls/winedos/int21.c Only check if were in Win16 mode in functions that realy need it. nog.
Index: dlls/winedos/int21.c =================================================================== RCS file: /home/wine/wine/dlls/winedos/int21.c,v retrieving revision 1.15 diff -u -r1.15 int21.c --- dlls/winedos/int21.c 6 Nov 2002 19:57:49 -0000 1.15 +++ dlls/winedos/int21.c 9 Nov 2002 09:43:44 -0000 @@ -78,11 +78,6 @@ { BYTE ascii; - if (DOSVM_IsWin16()) { - DOS3Call( context ); - return; - } - RESET_CFLAG(context); /* Not sure if this is a good idea */ if(AH_reg(context) == 0x0c) /* FLUSH BUFFER AND READ STANDARD INPUT */ @@ -105,7 +100,8 @@ { case 0x00: /* TERMINATE PROGRAM */ TRACE("TERMINATE PROGRAM\n"); - MZ_Exit( context, FALSE, 0 ); + if(DOSVM_IsWin16()) DOS3Call(context); + else MZ_Exit( context, FALSE, 0 ); break; case 0x01: /* READ CHARACTER FROM STANDARD INPUT, WITH ECHO */ @@ -176,13 +172,17 @@ break; case 0x25: /* SET INTERRUPT VECTOR */ - DOSVM_SetRMHandler( AL_reg(context), - (FARPROC16)MAKESEGPTR( context->SegDs, DX_reg(context))); + if(DOSVM_IsWin16()) DOS3Call(context); + else + DOSVM_SetRMHandler( AL_reg(context), + (FARPROC16)MAKESEGPTR( context->SegDs, + DX_reg(context))); break; case 0x35: /* GET INTERRUPT VECTOR */ TRACE("GET INTERRUPT VECTOR 0x%02x\n",AL_reg(context)); - { + if(DOSVM_IsWin16()) DOS3Call(context); + else { FARPROC16 addr = DOSVM_GetRMHandler( AL_reg(context) ); context->SegEs = SELECTOROF(addr); SET_BX( context, OFFSETOF(addr) ); @@ -209,17 +209,22 @@ case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */ TRACE("EXEC %s\n", (LPCSTR)CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx )); - if (!MZ_Exec( context, CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx), - AL_reg(context), CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Ebx) )) - { - SET_AX( context, GetLastError() ); - SET_CFLAG(context); - } + if(DOSVM_IsWin16()) DOS3Call(context); + else + if(!MZ_Exec(context, CTX_SEG_OFF_TO_LIN(context, context->SegDs, + context->Edx), AL_reg(context), + CTX_SEG_OFF_TO_LIN(context, context->SegEs, + context->Ebx))) + { + SET_AX(context, GetLastError()); + SET_CFLAG(context); + } break; case 0x4c: /* "EXIT" - TERMINATE WITH RETURN CODE */ TRACE("EXIT with return code %d\n",AL_reg(context)); - MZ_Exit( context, FALSE, AL_reg(context) ); + if(DOSVM_IsWin16()) DOS3Call(context); + else MZ_Exit( context, FALSE, AL_reg(context) ); break; case 0x4d: /* GET RETURN CODE */ @@ -237,11 +242,14 @@ TRACE("GET CURRENT PROCESS ID (GET PSP ADDRESS)\n"); /* FIXME: should we return the original DOS PSP upon */ /* Windows startup ? */ - SET_BX( context, DOSVM_psp ); + if(DOSVM_IsWin16()) DOS3Call(context); + else SET_BX( context, DOSVM_psp ); break; case 0x52: /* "SYSVARS" - GET LIST OF LISTS */ TRACE("SYSVARS - GET LIST OF LISTS\n"); + if(DOSVM_IsWin16()) DOS3Call(context); + else { context->SegEs = HIWORD(DOS_LOLSeg); SET_BX( context, FIELD_OFFSET(DOS_LISTOFLISTS, ptr_first_DPB) ); @@ -252,7 +260,8 @@ TRACE("GET CURRENT PSP ADDRESS\n"); /* FIXME: should we return the original DOS PSP upon */ /* Windows startup ? */ - SET_BX( context, DOSVM_psp ); + if(DOSVM_IsWin16()) DOS3Call(context); + else SET_BX( context, DOSVM_psp ); break; default: