Author: aandrejevic
Date: Thu Jul 18 12:31:11 2013
New Revision: 59502
URL:
http://svn.reactos.org/svn/reactos?rev=59502&view=rev
Log:
[NTVDM]
Fix several bugs.
Modified:
branches/ntvdm/subsystems/ntvdm/dos.c
branches/ntvdm/subsystems/ntvdm/dos.h
Modified: branches/ntvdm/subsystems/ntvdm/dos.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Thu Jul 18 12:31:11 2013
@@ -398,7 +398,7 @@
return TRUE;
}
-BOOLEAN DosLinkUmb()
+BOOLEAN DosLinkUmb(VOID)
{
DWORD Segment = FIRST_MCB_SEGMENT;
PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment);
@@ -423,7 +423,7 @@
return TRUE;
}
-BOOLEAN DosUnlinkUmb()
+BOOLEAN DosUnlinkUmb(VOID)
{
DWORD Segment = FIRST_MCB_SEGMENT;
PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment);
@@ -895,6 +895,7 @@
VOID DosTerminateProcess(WORD Psp, BYTE ReturnCode)
{
+ WORD i;
WORD McbSegment = FIRST_MCB_SEGMENT;
PDOS_MCB CurrentMcb;
LPDWORD IntVecTable = (LPDWORD)((ULONG_PTR)BaseAddress);
@@ -903,7 +904,11 @@
/* Check if this PSP is it's own parent */
if (PspBlock->ParentPsp == Psp) goto Done;
- // TODO: Close all handles opened by the process
+ for (i = 0; i < PspBlock->HandleTableSize; i++)
+ {
+ /* Close the handle */
+ DosCloseHandle(i);
+ }
/* Free the memory used by the process */
while (TRUE)
@@ -942,7 +947,7 @@
LOWORD(PspBlock->TerminateAddress));
}
-CHAR DosReadCharacter()
+CHAR DosReadCharacter(VOID)
{
CHAR Character = '\0';
WORD BytesRead;
@@ -1539,12 +1544,12 @@
}
}
-VOID DosBreakInterrupt()
+VOID DosBreakInterrupt(VOID)
{
VdmRunning = FALSE;
}
-BOOLEAN DosInitialize()
+BOOLEAN DosInitialize(VOID)
{
BYTE i;
PDOS_MCB Mcb = SEGMENT_TO_MCB(FIRST_MCB_SEGMENT);
Modified: branches/ntvdm/subsystems/ntvdm/dos.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.h?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/dos.h [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/dos.h [iso-8859-1] Thu Jul 18 12:31:11 2013
@@ -19,7 +19,7 @@
#define DOS_CONFIG_PATH L"%SystemRoot%\\system32\\CONFIG.NT"
#define DOS_COMMAND_INTERPRETER
L"%SystemRoot%\\system32\\COMMAND.COM /k
%SystemRoot%\\system32\\AUTOEXEC.NT"
#define FIRST_MCB_SEGMENT 0x1000
-#define USER_MEMORY_SIZE 0x8FFF
+#define USER_MEMORY_SIZE 0x8FFE
#define SYSTEM_PSP 0x08
#define SYSTEM_ENV_BLOCK 0x800
#define INVALID_DOS_HANDLE 0xFFFF
@@ -103,12 +103,12 @@
VOID DosInitializePsp(WORD PspSegment, LPCSTR CommandLine, WORD ProgramSize, WORD
Environment);
BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock);
VOID DosTerminateProcess(WORD Psp, BYTE ReturnCode);
-CHAR DosReadCharacter();
+CHAR DosReadCharacter(VOID);
VOID DosPrintCharacter(CHAR Character);
VOID DosInt20h(WORD CodeSegment);
VOID DosInt21h(WORD CodeSegment);
-VOID DosBreakInterrupt();
-BOOLEAN DosInitialize();
+VOID DosBreakInterrupt(VOID);
+BOOLEAN DosInitialize(VOID);
#endif