mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +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:
parent
0dfcc314e5
commit
bfb9c92b07
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue