From 579a784e0431e5400dacaf39ee6d97b0a380ebe9 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 27 Apr 2018 14:14:56 +0200 Subject: [PATCH] [NTOSKNRL] In case we leak a VACB, debug as much information as possible. CORE-14578 --- ntoskrnl/cc/view.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c index 081d881d15e..a0f08670805 100644 --- a/ntoskrnl/cc/view.c +++ b/ntoskrnl/cc/view.c @@ -1132,7 +1132,25 @@ CcRosDeleteFileCache ( current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); InitializeListHead(¤t->CacheMapVacbListEntry); Refs = CcRosVacbDecRefCount(current); +#if DBG // CORE-14578 + if (Refs != 0) + { + DPRINT1("Leaking VACB %p attached to %p (%I64d)\n", current, FileObject, current->FileOffset.QuadPart); + DPRINT1("There are: %d references left\n", Refs); + DPRINT1("Pin: %d, Map: %d\n", current->PinCount, current->MappedCount); + DPRINT1("Dirty: %d\n", current->Dirty); + if (FileObject->FileName.Length != 0) + { + DPRINT1("File was: %wZ\n", &FileObject->FileName); + } + else + { + DPRINT1("No name for the file\n"); + } + } +#else ASSERT(Refs == 0); +#endif } OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);