mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +00:00
[FASTFAT]
- Fix incorrect referencing in VfatCreateFile. vfatGetFCBForFile expects a reference on ParentFcb (and may release it), and also returns a referenced parent FCB. CORE-8756 #resolve svn path=/trunk/; revision=65276
This commit is contained in:
parent
46f478ab95
commit
0e9ce28f2c
|
@ -565,11 +565,14 @@ VfatCreateFile(
|
|||
LONG idx, FileNameLen;
|
||||
|
||||
ParentFcb = (FileObject->RelatedFileObject != NULL) ? FileObject->RelatedFileObject->FsContext : NULL;
|
||||
Status = vfatGetFCBForFile(DeviceExt, &ParentFcb, &TargetFcb, &PathNameU);
|
||||
|
||||
if (Status == STATUS_SUCCESS)
|
||||
if (ParentFcb)
|
||||
{
|
||||
vfatGrabFCB(DeviceExt, ParentFcb);
|
||||
}
|
||||
Status = vfatGetFCBForFile(DeviceExt, &ParentFcb, &TargetFcb, &PathNameU);
|
||||
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, TargetFcb);
|
||||
Irp->IoStatus.Information = FILE_EXISTS;
|
||||
}
|
||||
|
@ -623,6 +626,7 @@ VfatCreateFile(
|
|||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
pFcb = FileObject->FsContext;
|
||||
ASSERT(pFcb == ParentFcb);
|
||||
|
||||
if (pFcb->OpenHandleCount == 0)
|
||||
{
|
||||
|
@ -640,7 +644,6 @@ VfatCreateFile(
|
|||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
vfatReleaseFCB(DeviceExt, ParentFcb);
|
||||
VfatCloseFile(DeviceExt, FileObject);
|
||||
return Status;
|
||||
}
|
||||
|
|
|
@ -201,12 +201,6 @@ FATGetNextDirEntry(
|
|||
CcUnpinData(*pContext);
|
||||
}
|
||||
|
||||
if (!pDirFcb->FileObject)
|
||||
{
|
||||
DPRINT1("Buggy FCB (cleaned up)! %S (%d / %u)\n", pDirFcb->PathNameBuffer, pDirFcb->RefCount, pDirFcb->OpenHandleCount);
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
}
|
||||
|
||||
if (FileOffset.u.LowPart >= pDirFcb->RFCB.FileSize.u.LowPart ||
|
||||
!CcMapData(pDirFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, pContext, pPage))
|
||||
{
|
||||
|
|
|
@ -167,11 +167,6 @@ vfatFindDirSpace(
|
|||
{
|
||||
CcUnpinData(Context);
|
||||
}
|
||||
if (!pDirFcb->FileObject)
|
||||
{
|
||||
DPRINT1("Buggy FCB (cleaned up)! %S (%d / %u)\n", pDirFcb->PathNameBuffer, pDirFcb->RefCount, pDirFcb->OpenHandleCount);
|
||||
return FALSE;
|
||||
}
|
||||
if (!CcPinRead(pDirFcb->FileObject, &FileOffset, DeviceExt->FatInfo.BytesPerCluster,
|
||||
TRUE, &Context, (PVOID*)&pFatEntry))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue