mirror of
https://github.com/reactos/reactos.git
synced 2025-05-01 03:29:37 +00:00
[FASTFAT] Misc. fixes spotted by Thomas.
This commit is contained in:
parent
7c01587680
commit
d69f31848e
1 changed files with 13 additions and 2 deletions
|
@ -29,6 +29,7 @@ vfatFCBInitializeCacheFromVolume(
|
||||||
PVFATCCB newCCB;
|
PVFATCCB newCCB;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
BOOLEAN Acquired;
|
BOOLEAN Acquired;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* Don't re-initialize if already done */
|
/* Don't re-initialize if already done */
|
||||||
if (BooleanFlagOn(fcb->Flags, FCB_CACHE_INITIALIZED))
|
if (BooleanFlagOn(fcb->Flags, FCB_CACHE_INITIALIZED))
|
||||||
|
@ -58,8 +59,9 @@ vfatFCBInitializeCacheFromVolume(
|
||||||
newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
|
newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
|
||||||
if (newCCB == NULL)
|
if (newCCB == NULL)
|
||||||
{
|
{
|
||||||
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||||
ObDereferenceObject(fileObject);
|
ObDereferenceObject(fileObject);
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
goto Quit;
|
||||||
}
|
}
|
||||||
RtlZeroMemory(newCCB, sizeof (VFATCCB));
|
RtlZeroMemory(newCCB, sizeof (VFATCCB));
|
||||||
|
|
||||||
|
@ -83,19 +85,25 @@ vfatFCBInitializeCacheFromVolume(
|
||||||
fcb->FileObject = NULL;
|
fcb->FileObject = NULL;
|
||||||
ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, newCCB);
|
ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, newCCB);
|
||||||
ObDereferenceObject(fileObject);
|
ObDereferenceObject(fileObject);
|
||||||
|
if (Acquired)
|
||||||
|
{
|
||||||
|
ExReleaseResourceLite(&vcb->DirResource);
|
||||||
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
|
|
||||||
vfatGrabFCB(vcb, fcb);
|
vfatGrabFCB(vcb, fcb);
|
||||||
SetFlag(fcb->Flags, FCB_CACHE_INITIALIZED);
|
SetFlag(fcb->Flags, FCB_CACHE_INITIALIZED);
|
||||||
|
Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
Quit:
|
||||||
if (Acquired)
|
if (Acquired)
|
||||||
{
|
{
|
||||||
ExReleaseResourceLite(&vcb->DirResource);
|
ExReleaseResourceLite(&vcb->DirResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -682,6 +690,7 @@ FATAddEntry(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No need to init cache here, vfatFindDirSpace() will have done it for us */
|
/* No need to init cache here, vfatFindDirSpace() will have done it for us */
|
||||||
|
ASSERT(BooleanFlagOn(ParentFcb->Flags, FCB_CACHE_INITIALIZED));
|
||||||
|
|
||||||
i = DeviceExt->FatInfo.BytesPerCluster / sizeof(FAT_DIR_ENTRY);
|
i = DeviceExt->FatInfo.BytesPerCluster / sizeof(FAT_DIR_ENTRY);
|
||||||
FileOffset.u.HighPart = 0;
|
FileOffset.u.HighPart = 0;
|
||||||
|
@ -768,6 +777,7 @@ FATAddEntry(
|
||||||
Status = vfatFCBInitializeCacheFromVolume(DeviceExt, (*Fcb));
|
Status = vfatFCBInitializeCacheFromVolume(DeviceExt, (*Fcb));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ExFreePoolWithTag(Buffer, TAG_VFAT);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,6 +908,7 @@ FATXAddEntry(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No need to init cache here, vfatFindDirSpace() will have done it for us */
|
/* No need to init cache here, vfatFindDirSpace() will have done it for us */
|
||||||
|
ASSERT(BooleanFlagOn(ParentFcb->Flags, FCB_CACHE_INITIALIZED));
|
||||||
|
|
||||||
/* add entry into parent directory */
|
/* add entry into parent directory */
|
||||||
FileOffset.u.HighPart = 0;
|
FileOffset.u.HighPart = 0;
|
||||||
|
|
Loading…
Reference in a new issue