Author: aandrejevic
Date: Wed Jul 29 02:03:48 2015
New Revision: 68581
URL:
http://svn.reactos.org/svn/reactos?rev=68581&view=rev
Log:
[NTVDM]
- Combine free blocks after resizing.
- Fix the LastParagraph value in the PSP.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/memory.c [iso-8859-1] Wed Jul 29
02:03:48 2015
@@ -292,7 +292,8 @@
NewSize);
/* Just split the block */
- NextMcb = SEGMENT_TO_MCB(Segment + NewSize + 1);
+ NextSegment = Segment + NewSize + 1;
+ NextMcb = SEGMENT_TO_MCB(NextSegment);
NextMcb->BlockType = Mcb->BlockType;
NextMcb->Size = Mcb->Size - NewSize - 1;
NextMcb->OwnerPsp = 0;
@@ -300,6 +301,9 @@
/* Update the MCB */
Mcb->BlockType = 'M';
Mcb->Size = NewSize;
+
+ /* Combine this free block with adjoining free blocks */
+ DosCombineFreeBlocks(NextSegment);
}
Done:
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Wed Jul 29
02:03:48 2015
@@ -198,7 +198,7 @@
PspBlock->Exit[1] = 0x20;
/* Set the number of the last paragraph */
- PspBlock->LastParagraph = Segment + ProgramSize - 1;
+ PspBlock->LastParagraph = Segment + ProgramSize;
/* Save the interrupt vectors */
PspBlock->TerminateAddress = IntVecTable[0x22];