mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +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:
parent
a47b155648
commit
9de7dafcc9
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue