Author: ion
Date: Mon Feb 27 17:17:31 2012
New Revision: 55886
URL:
http://svn.reactos.org/svn/reactos?rev=55886&view=rev
Log:
[NTOSKRNL]: Don't assert if there's no VAD found in NtFreeVirtualMemory... perhaps
a wrong address was used on purpose (such as during a Winetest). Simply do what ROS does
when a MAREA is not found and return failure. However if a VAD *was* found, keep all the
other ASSERTs...
Modified:
trunk/reactos/ntoskrnl/mm/anonmem.c
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Mon Feb 27 17:17:31 2012
@@ -1149,6 +1149,12 @@
StartingAddress = (ULONG_PTR)PAGE_ALIGN(PBaseAddress);
EndingAddress = ((ULONG_PTR)PBaseAddress + PRegionSize - 1) | (PAGE_SIZE - 1);
Vad = MiLocateAddress((PVOID)StartingAddress);
+ if (!Vad)
+ {
+ DPRINT1("Unable to VAD for address 0x%p\n", BaseAddress);
+ Status = STATUS_UNABLE_TO_FREE_VM;
+ goto unlock_deref_and_return;
+ }
/* This is the kind of VAD we expect right now */
ASSERT(Vad);