Author: jgardou
Date: Tue Jul 12 17:36:52 2011
New Revision: 52658
URL:
http://svn.reactos.org/svn/reactos?rev=52658&view=rev
Log:
[APITEST]
- add one more test to NtFreeVirtualMemory
Modified:
trunk/rostests/apitests/ntdll/NtFreeVirtualMemory.c
Modified: trunk/rostests/apitests/ntdll/NtFreeVirtualMemory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtFreeVirt…
==============================================================================
--- trunk/rostests/apitests/ntdll/NtFreeVirtualMemory.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/ntdll/NtFreeVirtualMemory.c [iso-8859-1] Tue Jul 12 17:36:52
2011
@@ -110,6 +110,28 @@
ok(NT_SUCCESS(Status), "NtFreeVirtualMemory failed : 0x%08x\n", Status);
ok(Length == PAGE_SIZE, "Length mismatch : 0x08x\n", Length);
ok(Buffer2 == (PVOID)((ULONG_PTR)Buffer+PAGE_SIZE), "The buffer is not aligned
to PAGE_SIZE.\n");
+
+ /* Now allocate two pages and try to free them in the middle */
+ Length = 2*PAGE_SIZE;
+ Status = NtAllocateVirtualMemory(NtCurrentProcess(),
+ &Buffer,
+ 0,
+ &Length,
+ MEM_RESERVE,
+ PAGE_READWRITE);
+ ok(NT_SUCCESS(Status), "NtAllocateVirtualMemory failed : 0x%08x\n",
Status);
+ ok(Length == 2*PAGE_SIZE, "Length mismatch : 0x08x\n", Length);
+ ok(((ULONG_PTR)Buffer % PAGE_SIZE) == 0, "The buffer is not aligned to
PAGE_SIZE.\n");
+
+ Buffer2 = (PVOID)((ULONG_PTR)Buffer+1);
+ Length = PAGE_SIZE;
+ Status = NtFreeVirtualMemory(NtCurrentProcess(),
+ &Buffer2,
+ &Length,
+ MEM_RELEASE);
+ ok(NT_SUCCESS(Status), "NtAllocateVirtualMemory failed : 0x%08x\n",
Status);
+ ok(Length == 2*PAGE_SIZE, "Length mismatch : 0x08x\n", Length);
+ ok(Buffer2 == Buffer, "The buffer is not aligned to PAGE_SIZE.\n");
}
START_TEST(NtFreeVirtualMemory)