- Combine free blocks after resizing.
- Fix the LastParagraph value in the PSP.


svn path=/trunk/; revision=68581
This commit is contained in:
Aleksandar Andrejevic 2015-07-29 02:03:48 +00:00
parent 0dfcc314e5
commit bfb9c92b07
2 changed files with 6 additions and 2 deletions

View file

@ -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:

View file

@ -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];