[FASTFAT] When not able to lock a volume due to open handles, print open handles

This commit is contained in:
Pierre Schweitzer 2017-12-17 18:19:03 +01:00
parent ab7ddc44f7
commit 27773dbb3f
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

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