DosResizeMemory shouldn't succeed unless the memory block has been resized to the specified amount.


svn path=/trunk/; revision=63331
This commit is contained in:
Aleksandar Andrejevic 2014-05-17 15:29:07 +00:00
parent a47b155648
commit 9de7dafcc9

View file

@ -249,6 +249,14 @@ static BOOLEAN DosResizeMemory(WORD BlockData, WORD NewSize, WORD *MaxAvailable)
/* Set the maximum possible size of the block */
ReturnSize += NextMcb->Size + 1;
if (ReturnSize < NewSize)
{
DPRINT("Cannot expand memory block: insufficient free segments available!\n");
DosLastError = ERROR_NOT_ENOUGH_MEMORY;
Success = FALSE;
goto Done;
}
/* Maximize the current block */
Mcb->Size = ReturnSize;
Mcb->BlockType = NextMcb->BlockType;