[PATCH v4 3/6] kernel32/tests: Add tests for NtAllocateVirtualMemory with size_ptr == NULL

Rémi Bernon rbernon at codeweavers.com
Tue May 28 05:15:15 CDT 2019


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/kernel32/tests/virtual.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 1778509d2ac..79eed345910 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -442,6 +442,11 @@ static void test_VirtualAlloc(void)
     addr2 = VirtualAlloc(addr1, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
     ok(addr2 == addr1, "VirtualAlloc returned %p, expected %p\n", addr2, addr1);
 
+    /* size_ptr should not be NULL */
+    status = pNtAllocateVirtualMemory(GetCurrentProcess(), NULL, 0, NULL,
+                                      MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+    ok(status == STATUS_ACCESS_VIOLATION, "NtAllocateVirtualMemory returned %08x\n", status);
+
     /* allocation conflicts because of 64k align */
     size = 0x1000;
     addr2 = (char *)addr1 + 0x1000;
-- 
2.20.1




More information about the wine-devel mailing list