https://git.reactos.org/?p=reactos.git;a=commitdiff;h=27773dbb3f1ab3f93a24a…
commit 27773dbb3f1ab3f93a24a742bec91676bf3a70a4
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Dec 17 18:19:03 2017 +0100
[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 a406276ee6..f059410044 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;
}