mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
** WIP ** [NTFS] Investigate why OpenHandleCount underflows to negative values...
This commit is contained in:
parent
945e2bda94
commit
66edbfa4f4
4 changed files with 16 additions and 1 deletions
|
@ -52,8 +52,12 @@ NtfsCleanupFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
if (!Fcb)
|
if (!Fcb)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
DPRINT1("DeviceExt->OpenHandleCount = 0x%lx\n", DeviceExt->OpenHandleCount);
|
||||||
|
DPRINT1("Fcb->OpenHandleCount = 0x%lx\n", Fcb->OpenHandleCount);
|
||||||
|
|
||||||
if (Fcb->Flags & FCB_IS_VOLUME)
|
if (Fcb->Flags & FCB_IS_VOLUME)
|
||||||
{
|
{
|
||||||
|
ASSERT(Fcb->OpenHandleCount > 0);
|
||||||
Fcb->OpenHandleCount--;
|
Fcb->OpenHandleCount--;
|
||||||
|
|
||||||
if (Fcb->OpenHandleCount != 0)
|
if (Fcb->OpenHandleCount != 0)
|
||||||
|
@ -68,6 +72,7 @@ NtfsCleanupFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
return STATUS_PENDING;
|
return STATUS_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT(Fcb->OpenHandleCount > 0);
|
||||||
Fcb->OpenHandleCount--;
|
Fcb->OpenHandleCount--;
|
||||||
|
|
||||||
CcUninitializeCacheMap(FileObject, &Fcb->RFCB.FileSize, NULL);
|
CcUninitializeCacheMap(FileObject, &Fcb->RFCB.FileSize, NULL);
|
||||||
|
|
|
@ -59,12 +59,17 @@ NtfsCloseFile(PDEVICE_EXTENSION DeviceExt,
|
||||||
FileObject->FsContext2 = NULL;
|
FileObject->FsContext2 = NULL;
|
||||||
FileObject->FsContext = NULL;
|
FileObject->FsContext = NULL;
|
||||||
FileObject->SectionObjectPointer = NULL;
|
FileObject->SectionObjectPointer = NULL;
|
||||||
|
|
||||||
|
DPRINT1("DeviceExt->OpenHandleCount = 0x%lx\n", DeviceExt->OpenHandleCount);
|
||||||
|
DPRINT1("Fcb->OpenHandleCount = 0x%lx\n", Fcb->OpenHandleCount);
|
||||||
|
|
||||||
|
ASSERT(DeviceExt->OpenHandleCount > 0);
|
||||||
DeviceExt->OpenHandleCount--;
|
DeviceExt->OpenHandleCount--;
|
||||||
|
|
||||||
if (FileObject->FileName.Buffer)
|
if (FileObject->FileName.Buffer)
|
||||||
{
|
{
|
||||||
// This a FO, that was created outside from FSD.
|
// This a FO, that was created outside from FSD.
|
||||||
// Some FO's are created with IoCreateStreamFileObject() insid from FSD.
|
// Some FO's are created with IoCreateStreamFileObject() inside from FSD.
|
||||||
// This FO's don't have a FileName.
|
// This FO's don't have a FileName.
|
||||||
NtfsReleaseFCB(DeviceExt, Fcb);
|
NtfsReleaseFCB(DeviceExt, Fcb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -606,6 +606,9 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
Fcb->OpenHandleCount++;
|
Fcb->OpenHandleCount++;
|
||||||
DeviceExt->OpenHandleCount++;
|
DeviceExt->OpenHandleCount++;
|
||||||
|
|
||||||
|
DPRINT1("DeviceExt->OpenHandleCount = 0x%lx\n", DeviceExt->OpenHandleCount);
|
||||||
|
DPRINT1("Fcb->OpenHandleCount = 0x%lx\n", Fcb->OpenHandleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -876,6 +876,8 @@ LockOrUnlockVolume(PDEVICE_EXTENSION DeviceExt,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Deny locking if we're not alone */
|
/* Deny locking if we're not alone */
|
||||||
|
DPRINT1("DeviceExt->OpenHandleCount = 0x%lx\n", DeviceExt->OpenHandleCount);
|
||||||
|
DPRINT1("Fcb->OpenHandleCount = 0x%lx\n", Fcb->OpenHandleCount);
|
||||||
if (Lock && DeviceExt->OpenHandleCount != 1)
|
if (Lock && DeviceExt->OpenHandleCount != 1)
|
||||||
{
|
{
|
||||||
return STATUS_ACCESS_DENIED;
|
return STATUS_ACCESS_DENIED;
|
||||||
|
|
Loading…
Reference in a new issue