Author: pschweitzer
Date: Wed Sep 13 16:38:32 2017
New Revision: 75835
URL:
http://svn.reactos.org/svn/reactos?rev=75835&view=rev
Log:
[KMTESTS:MM]
Few tests for MmBuildMdlForNonPagedPool() I wrote earlier.
They all pass fine on ROS.
Modified:
trunk/rostests/kmtests/ntos_mm/MmMdl.c
Modified: trunk/rostests/kmtests/ntos_mm/MmMdl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/ntos_mm/MmMdl.c?r…
==============================================================================
--- trunk/rostests/kmtests/ntos_mm/MmMdl.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/ntos_mm/MmMdl.c [iso-8859-1] Wed Sep 13 16:38:32 2017
@@ -188,7 +188,56 @@
}
}
+static
+VOID
+TestMmBuildMdlForNonPagedPool(VOID)
+{
+ PVOID Page;
+ PMDL Mdl;
+
+ Page = ExAllocatePoolWithTag(PagedPool, PAGE_SIZE, 'Test');
+ ok(Page != NULL, "ExAllocatePoolWithTag failed\n");
+ if (skip(Page != NULL, "No buffer\n"))
+ return;
+
+ Mdl = IoAllocateMdl(Page, PAGE_SIZE, FALSE, FALSE, NULL);
+ ok(Mdl != NULL, "IoAllocateMdl failed\n");
+ if (skip(Mdl != NULL, "No MDL\n"))
+ return;
+
+ ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) == 0, "MDL locked\n");
+ ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non
paged\n");
+
+ MmBuildMdlForNonPagedPool(Mdl);
+ ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) == 0, "MDL locked\n");
+ ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) != 0, "MDL from
paged\n");
+
+ IoFreeMdl(Mdl);
+ ExFreePoolWithTag(Page, 'Test');
+
+ Page = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, 'Test');
+ ok(Page != NULL, "ExAllocatePoolWithTag failed\n");
+ if (skip(Page != NULL, "No buffer\n"))
+ return;
+
+ Mdl = IoAllocateMdl(Page, PAGE_SIZE, FALSE, FALSE, NULL);
+ ok(Mdl != NULL, "IoAllocateMdl failed\n");
+ if (skip(Mdl != NULL, "No MDL\n"))
+ return;
+
+ ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) == 0, "MDL locked\n");
+ ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non
paged\n");
+
+ MmBuildMdlForNonPagedPool(Mdl);
+ ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) == 0, "MDL locked\n");
+ ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) != 0, "MDL from
paged\n");
+
+ IoFreeMdl(Mdl);
+ ExFreePoolWithTag(Page, 'Test');
+}
+
START_TEST(MmMdl)
{
TestMmAllocatePagesForMdl();
+ TestMmBuildMdlForNonPagedPool();
}