From 9ac91a4ca5c6e3fe0840a0e6939bb2f2af4df74b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 15 Sep 2017 10:37:00 +0000 Subject: [PATCH] [KMTESTS:CC] Tests for paging IO MDL for read operations. Equivalent to r75833 (and r75840). They fail in ROS. svn path=/trunk/; revision=75842 --- rostests/kmtests/ntos_cc/CMakeLists.txt | 17 ++++++++++++++++- rostests/kmtests/ntos_cc/CcCopyRead_drv.c | 8 ++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/rostests/kmtests/ntos_cc/CMakeLists.txt b/rostests/kmtests/ntos_cc/CMakeLists.txt index 7155dce0be6..6baf8f1663a 100644 --- a/rostests/kmtests/ntos_cc/CMakeLists.txt +++ b/rostests/kmtests/ntos_cc/CMakeLists.txt @@ -2,7 +2,7 @@ include_directories(../include) # -# IoCreateFile +# CcCopyRead # list(APPEND CCCOPYREAD_DRV_SOURCE ../kmtest_drv/kmtest_standalone.c @@ -15,3 +15,18 @@ add_importlibs(cccopyread_drv ntoskrnl hal) add_target_compile_definitions(cccopyread_drv KMT_STANDALONE_DRIVER) #add_pch(cccopyread_drv ../include/kmt_test.h) add_rostests_file(TARGET cccopyread_drv) + +# +# CcInitializeCacheMap +# +list(APPEND CCINITIALIZECACHEMAP_DRV_SOURCE + ../kmtest_drv/kmtest_standalone.c + CcInitializeCacheMap_drv.c) + +add_library(ccinitializecachemap_drv SHARED ${CCINITIALIZECACHEMAP_DRV_SOURCE}) +set_module_type(ccinitializecachemap_drv kernelmodedriver) +target_link_libraries(ccinitializecachemap_drv kmtest_printf ${PSEH_LIB}) +add_importlibs(ccinitializecachemap_drv ntoskrnl hal) +add_target_compile_definitions(ccinitializecachemap_drv KMT_STANDALONE_DRIVER) +#add_pch(ccinitializecachemap_drv ../include/kmt_test.h) +add_rostests_file(TARGET ccinitializecachemap_drv) diff --git a/rostests/kmtests/ntos_cc/CcCopyRead_drv.c b/rostests/kmtests/ntos_cc/CcCopyRead_drv.c index 98b4d87e101..94d73722280 100644 --- a/rostests/kmtests/ntos_cc/CcCopyRead_drv.c +++ b/rostests/kmtests/ntos_cc/CcCopyRead_drv.c @@ -269,6 +269,8 @@ TestIrpHandler( } else { + PMDL Mdl; + ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart); ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length); @@ -282,6 +284,12 @@ TestIrpHandler( { *(PUSHORT)((ULONG_PTR)Buffer + (ULONG_PTR)(1000LL - Offset.QuadPart)) = 0xFFFF; } + + Mdl = Irp->MdlAddress; + ok(Mdl != NULL, "Null pointer for MDL!\n"); + ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n"); + ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n"); + ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n"); } if (NT_SUCCESS(Status)) -- 2.17.1