From 695beeee785964e7869ed46fd474d6ffa5bee7dc Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 27 Nov 2016 10:49:33 +0000 Subject: [PATCH] [KMTESTS:MM] Check the first byte is really null, in spite of the hack writing. CORE-11819 CORE-12475 svn path=/trunk/; revision=73392 --- rostests/kmtests/ntos_mm/NtCreateSection_drv.c | 3 ++- rostests/kmtests/ntos_mm/NtCreateSection_user.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rostests/kmtests/ntos_mm/NtCreateSection_drv.c b/rostests/kmtests/ntos_mm/NtCreateSection_drv.c index 88693081f0b..bc84a166787 100644 --- a/rostests/kmtests/ntos_mm/NtCreateSection_drv.c +++ b/rostests/kmtests/ntos_mm/NtCreateSection_drv.c @@ -404,7 +404,8 @@ TestIrpHandler( { Fcb = IoStack->FileObject->FsContext; ok(Fcb != NULL, "Null pointer!\n"); - if (IoStack->FileObject->PrivateCacheMap != NULL) + if (IoStack->FileObject->SectionObjectPointer != NULL && + IoStack->FileObject->SectionObjectPointer->SharedCacheMap != NULL) { CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL); CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE); diff --git a/rostests/kmtests/ntos_mm/NtCreateSection_user.c b/rostests/kmtests/ntos_mm/NtCreateSection_user.c index 2966adfb005..f5127ec8141 100644 --- a/rostests/kmtests/ntos_mm/NtCreateSection_user.c +++ b/rostests/kmtests/ntos_mm/NtCreateSection_user.c @@ -53,6 +53,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 512); KmtEndSeh(STATUS_SUCCESS); @@ -78,6 +79,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 4096); KmtEndSeh(STATUS_SUCCESS); @@ -103,6 +105,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 512); KmtEndSeh(STATUS_SUCCESS); @@ -128,6 +131,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 4096); KmtEndSeh(STATUS_SUCCESS); @@ -165,6 +169,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 512); KmtEndSeh(STATUS_SUCCESS); @@ -190,6 +195,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 4096); KmtEndSeh(STATUS_SUCCESS); @@ -215,6 +221,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 512); KmtEndSeh(STATUS_SUCCESS); @@ -240,6 +247,7 @@ START_TEST(NtCreateSection) ok_eq_hex(Status, STATUS_SUCCESS); KmtStartSeh(); + ok(((PCHAR)Buffer)[0] == 0, "First byte is not null! %x", ((PCHAR)Buffer)[0]); memset(Buffer, 0xBA, 4096); KmtEndSeh(STATUS_SUCCESS); -- 2.17.1