[KMTESTS:CC] Add IRQL tests for CcCopyRead showing that a spinlock is held during Cc IO operations.

CORE-14349
This commit is contained in:
Pierre Schweitzer 2018-02-18 13:58:01 +01:00
parent 888ace4397
commit 3fe0e280b1
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -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);