https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3fe0e280b1ab4305c753e…
commit 3fe0e280b1ab4305c753e1facae0323e5053ac3b
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Feb 18 13:58:01 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Feb 18 14:00:38 2018 +0100
[KMTESTS:CC] Add IRQL tests for CcCopyRead showing that a spinlock is held during Cc
IO operations.
CORE-14349
---
modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c
b/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c
index cc98945a04..d7540f72e0 100644
--- a/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcCopyRead_drv.c
@@ -172,6 +172,8 @@ TestIrpHandler(
if (IoStack->MajorFunction == IRP_MJ_CREATE)
{
+ ok(KeGetCurrentIrql() == PASSIVE_LEVEL, "Wrong IRQL: %d\n",
KeGetCurrentIrql());
+
if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR))
{
TestDeviceObject = DeviceObject;
@@ -235,6 +237,7 @@ TestIrpHandler(
if (!FlagOn(Irp->Flags, IRP_NOCACHE))
{
+ ok(KeGetCurrentIrql() == PASSIVE_LEVEL, "Wrong IRQL: %d\n",
KeGetCurrentIrql());
ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n",
Offset.QuadPart);
ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length);
@@ -271,6 +274,7 @@ TestIrpHandler(
{
PMDL Mdl;
+ ok(KeGetCurrentIrql() == APC_LEVEL, "Wrong IRQL: %d\n",
KeGetCurrentIrql());
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);
@@ -301,6 +305,7 @@ TestIrpHandler(
}
else if (IoStack->MajorFunction == IRP_MJ_CLEANUP)
{
+ ok(KeGetCurrentIrql() == PASSIVE_LEVEL, "Wrong IRQL: %d\n",
KeGetCurrentIrql());
KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
CcUninitializeCacheMap(IoStack->FileObject, NULL, &CacheUninitEvent);
KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE,
NULL);