mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 12:23:25 +00:00
[NTVDM]
- Combine free blocks after resizing. - Fix the LastParagraph value in the PSP. svn path=/trunk/; revision=68581
This commit is contained in:
@@ -292,7 +292,8 @@ BOOLEAN DosResizeMemory(WORD BlockData, WORD NewSize, WORD *MaxAvailable)
|
||||
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 @@ BOOLEAN DosResizeMemory(WORD BlockData, WORD NewSize, WORD *MaxAvailable)
|
||||
/* Update the MCB */
|
||||
Mcb->BlockType = 'M';
|
||||
Mcb->Size = NewSize;
|
||||
|
||||
/* Combine this free block with adjoining free blocks */
|
||||
DosCombineFreeBlocks(NextSegment);
|
||||
}
|
||||
|
||||
Done:
|
||||
|
||||
@@ -198,7 +198,7 @@ VOID DosCreatePsp(WORD Segment, WORD ProgramSize)
|
||||
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];
|
||||
|
||||
Reference in New Issue
Block a user