[NTVDM]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Tue, 29 Oct 2013 00:10:14 +0000 (00:10 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Tue, 29 Oct 2013 00:10:14 +0000 (00:10 +0000)
Save the error code returned by applications.

svn path=/branches/ntvdm/; revision=60789

subsystems/ntvdm/dos.c

index 80a330d..0ada941 100644 (file)
@@ -28,6 +28,7 @@ static HANDLE DosSystemFileTable[DOS_SFT_SIZE];
 static WORD DosSftRefCount[DOS_SFT_SIZE];
 static BYTE DosAllocStrategy = DOS_ALLOC_BEST_FIT;
 static BOOLEAN DosUmbLinked = FALSE;
 static WORD DosSftRefCount[DOS_SFT_SIZE];
 static BYTE DosAllocStrategy = DOS_ALLOC_BEST_FIT;
 static BOOLEAN DosUmbLinked = FALSE;
+static BYTE DosErrorLevel = 0;
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
@@ -1259,6 +1260,9 @@ Done:
         if (CurrentPsp == SYSTEM_PSP) VdmRunning = FALSE;
     }
 
         if (CurrentPsp == SYSTEM_PSP) VdmRunning = FALSE;
     }
 
+    /* Save the return code */
+    DosErrorLevel = ReturnCode;
+
     /* Return control to the parent process */
     EmulatorExecute(HIWORD(PspBlock->TerminateAddress),
                     LOWORD(PspBlock->TerminateAddress));
     /* Return control to the parent process */
     EmulatorExecute(HIWORD(PspBlock->TerminateAddress),
                     LOWORD(PspBlock->TerminateAddress));