[NTDLL_APITEST] Add test for invalid pointer
authorDmitry Chapyshev <dmitry@reactos.org>
Sun, 25 Sep 2016 16:57:55 +0000 (16:57 +0000)
committerDmitry Chapyshev <dmitry@reactos.org>
Sun, 25 Sep 2016 16:57:55 +0000 (16:57 +0000)
svn path=/trunk/; revision=72801

rostests/apitests/ntdll/RtlAllocateHeap.c

index 40ade2d..829983c 100644 (file)
@@ -62,4 +62,16 @@ START_TEST(RtlAllocateHeap)
     RtlDestroyHeap(hHeap);
 
     ok(Aligned == TRUE, "Unaligned address returned\n");
     RtlDestroyHeap(hHeap);
 
     ok(Aligned == TRUE, "Unaligned address returned\n");
+
+    _SEH2_TRY
+    {
+        hHeap = RtlCreateHeap(HEAP_CREATE_ALIGN_16, NULL, 0, 0, NULL, (PRTL_HEAP_PARAMETERS)0xdeadbeef);
+    }
+    _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+    {
+        hHeap = INVALID_HANDLE_VALUE;
+    }
+    _SEH2_END;
+
+    ok(hHeap == NULL, "Unexpected heap value: %p\n", hHeap);
 }
 }