From 27773dbb3f1ab3f93a24a742bec91676bf3a70a4 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 17 Dec 2017 18:19:03 +0100 Subject: [PATCH] [FASTFAT] When not able to lock a volume due to open handles, print open handles --- drivers/filesystems/fastfat/fsctl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/filesystems/fastfat/fsctl.c b/drivers/filesystems/fastfat/fsctl.c index a406276ee64..f059410044e 100644 --- a/drivers/filesystems/fastfat/fsctl.c +++ b/drivers/filesystems/fastfat/fsctl.c @@ -1115,6 +1115,22 @@ VfatLockOrUnlockVolume( /* Deny locking if we're not alone */ if (Lock && DeviceExt->OpenHandleCount != 1) { + PLIST_ENTRY ListEntry; + + DPRINT1("Can't lock: %u opened\n", DeviceExt->OpenHandleCount); + + ListEntry = DeviceExt->FcbListHead.Flink; + while (ListEntry != &DeviceExt->FcbListHead) + { + Fcb = CONTAINING_RECORD(ListEntry, VFATFCB, FcbListEntry); + ListEntry = ListEntry->Flink; + + if (Fcb->OpenHandleCount > 0) + { + DPRINT1("Opened (%u - %u): %wZ\n", Fcb->OpenHandleCount, Fcb->RefCount, &Fcb->PathNameU); + } + } + return STATUS_ACCESS_DENIED; }