Author: aandrejevic Date: Thu Apr 23 01:17:11 2015 New Revision: 67362
URL: http://svn.reactos.org/svn/reactos?rev=67362&view=rev Log: [NTVDM] Implement INT 21h, AH = 34h (Get Address of InDOS Flag).
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/d... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Thu Apr 23 01:17:11 2015 @@ -31,6 +31,8 @@
/* PRIVATE VARIABLES **********************************************************/
+#define INDOS_POINTER MAKELONG(0x00FE, 0x0070) + CALLBACK16 DosContext;
static DWORD DiskTransferArea; @@ -39,6 +41,7 @@ static CHAR CurrentDirectories[NUM_DRIVES][DOS_DIR_LENGTH]; static DOS_SFT_ENTRY DosSystemFileTable[DOS_SFT_SIZE]; static WORD DosErrorLevel = 0x0000; +static PBYTE InDos;
/* PUBLIC VARIABLES ***********************************************************/
@@ -1369,6 +1372,8 @@ PDOS_COUNTRY_CODE_BUFFER CountryCodeBuffer; INT Return;
+ (*InDos)++; + /* Check the value in the AH register */ switch (getAH()) { @@ -1546,7 +1551,12 @@ DosPrintCharacter(DOS_OUTPUT_HANDLE, '^'); DosPrintCharacter(DOS_OUTPUT_HANDLE, 'C');
- if (DosControlBreak()) return; + if (DosControlBreak()) + { + /* Set the character to a newline to exit the loop */ + Character = '\r'; + } + break; }
@@ -1873,6 +1883,15 @@ break; }
+ /* Get Address of InDOS flag */ + case 0x34: + { + setES(HIWORD(INDOS_POINTER)); + setBX(LOWORD(INDOS_POINTER)); + + break; + } + /* Get Interrupt Vector */ case 0x35: { @@ -2895,6 +2914,8 @@ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; } } + + (*InDos)--; }
VOID WINAPI DosBreakInterrupt(LPWORD Stack) @@ -2985,6 +3006,10 @@ FILE *Stream; WCHAR Buffer[256];
+ /* Setup the InDOS flag */ + InDos = (PBYTE)FAR_POINTER(INDOS_POINTER); + *InDos = 0; + /* Clear the current directory buffer */ RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));