Author: tfaber
Date: Sat Dec 24 10:26:04 2011
New Revision: 54748

URL: http://svn.reactos.org/svn/reactos?rev=54748&view=rev
Log:
[NTDLL_APITEST]
- NtAllocateVirtualMemory: fix handling of an error condition; check that 
newly-committed memory is zeroed

Modified:
    trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c

Modified: trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c?rev=54748&r1=54747&r2=54748&view=diff
==============================================================================
--- trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c [iso-8859-1] 
(original)
+++ trunk/rostests/apitests/ntdll/NtAllocateVirtualMemory.c [iso-8859-1] Sat 
Dec 24 10:26:04 2011
@@ -60,11 +60,13 @@
     Status = NtAllocateVirtualMemory(NtCurrentProcess(), &FirstPageStart, 0, 
&Size, MEM_COMMIT, PAGE_READWRITE);
     if (!NT_SUCCESS(Status))
     {
-        Size = 0;
+        AllocationSize = 0;
         Status = NtFreeVirtualMemory(NtCurrentProcess(), &AllocationStart, 
&AllocationSize, MEM_RELEASE);
         ASSERT(Status == STATUS_SUCCESS);
         return NULL;
     }
+    ASSERT(Size % sizeof(ULONG) == 0);
+    ASSERT(RtlCompareMemoryUlong(FirstPageStart, Size, 0) == Size);
 
     UserBuffer = AllocationStart;
     UserBuffer += AllocationSize - PAGE_SIZE - DataSize;


Reply via email to