mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 12:23:25 +00:00
[NTVDM]
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user