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
/* Take ownership of the block */
CurrentMcb->OwnerPsp = CurrentPsp;
/* Take ownership of the block */
CurrentMcb->OwnerPsp = CurrentPsp;
+ /* 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 */
PDOS_MCB Mcb = SEGMENT_TO_MCB(Segment), NextMcb;
/* Make sure this is a valid, allocated block */
-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;
/* Make sure the MCB is valid */
if (Mcb->BlockType != 'M' && Mcb->BlockType != 'Z') return FALSE;
VOID BiosPrintCharacter(CHAR Character, BYTE Attribute);
BOOLEAN DosInitialize();
WORD DosAllocateMemory(WORD Size, WORD *MaxAvailable);
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);
BOOLEAN DosCreateProcess(LPCSTR CommandLine, WORD EnvBlock);
VOID DosInt20h(WORD CodeSegment);
VOID DosInt21h(WORD CodeSegment);