Fix the VDM DOS memory manager to use the segment of the data portion of the block, rather than the MCB itself.


svn path=/branches/ntvdm/; revision=59338
This commit is contained in:
Aleksandar Andrejevic 2013-06-25 16:46:35 +00:00
parent 5db2a4a6dd
commit 6d45f4e6e3
2 changed files with 8 additions and 7 deletions

View file

@ -148,12 +148,13 @@ Next:
/* Take ownership of the block */
CurrentMcb->OwnerPsp = CurrentPsp;
return Result;
/* Return the segment of the data portion of the block */
return Result + 1;
}
WORD DosResizeMemory(WORD Segment, WORD NewSize)
WORD DosResizeMemory(WORD BlockData, WORD NewSize)
{
WORD ReturnSize = 0, NextSegment;
WORD Segment = BlockData - 1, ReturnSize = 0, NextSegment;
PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment), NextMcb;
/* Make sure this is a valid, allocated block */
@ -222,9 +223,9 @@ WORD DosResizeMemory(WORD Segment, WORD NewSize)
return ReturnSize;
}
BOOLEAN DosFreeMemory(WORD Segment)
BOOLEAN DosFreeMemory(WORD BlockData)
{
PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment);
PDOS_MCB Mcb = SEGMENT_TO_MCB(BlockData - 1);
/* Make sure the MCB is valid */
if (Mcb->BlockType != 'M' && Mcb->BlockType != 'Z') return FALSE;

View file

@ -207,8 +207,8 @@ VOID BiosUpdateConsole(ULONG StartAddress, ULONG EndAddress);
VOID BiosPrintCharacter(CHAR Character, BYTE Attribute);
BOOLEAN DosInitialize();
WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable);
BOOLEAN DosFreeMemory(WORD Segment);
WORD DosResizeMemory(WORD Segment, WORD NewSize);
BOOLEAN DosFreeMemory(WORD BlockData);
WORD DosResizeMemory(WORD BlockData, WORD NewSize);
BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock);
VOID DosInt20h(WORD CodeSegment);
VOID DosInt21h(WORD CodeSegment);