mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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;
|
||||
NTSTATUS status;
|
||||
BOOLEAN Acquired;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Don't re-initialize if already done */
|
||||
if (BooleanFlagOn(fcb->Flags, FCB_CACHE_INITIALIZED))
|
||||
|
@ -58,8 +59,9 @@ vfatFCBInitializeCacheFromVolume(
|
|||
newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
|
||||
if (newCCB == NULL)
|
||||
{
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
ObDereferenceObject(fileObject);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto Quit;
|
||||
}
|
||||
RtlZeroMemory(newCCB, sizeof (VFATCCB));
|
||||
|
||||
|
@ -83,19 +85,25 @@ vfatFCBInitializeCacheFromVolume(
|
|||
fcb->FileObject = NULL;
|
||||
ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, newCCB);
|
||||
ObDereferenceObject(fileObject);
|
||||
if (Acquired)
|
||||
{
|
||||
ExReleaseResourceLite(&vcb->DirResource);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
vfatGrabFCB(vcb, fcb);
|
||||
SetFlag(fcb->Flags, FCB_CACHE_INITIALIZED);
|
||||
Status = STATUS_SUCCESS;
|
||||
|
||||
Quit:
|
||||
if (Acquired)
|
||||
{
|
||||
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 */
|
||||
ASSERT(BooleanFlagOn(ParentFcb->Flags, FCB_CACHE_INITIALIZED));
|
||||
|
||||
i = DeviceExt->FatInfo.BytesPerCluster / sizeof(FAT_DIR_ENTRY);
|
||||
FileOffset.u.HighPart = 0;
|
||||
|
@ -768,6 +777,7 @@ FATAddEntry(
|
|||
Status = vfatFCBInitializeCacheFromVolume(DeviceExt, (*Fcb));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ExFreePoolWithTag(Buffer, TAG_VFAT);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -898,6 +908,7 @@ FATXAddEntry(
|
|||
}
|
||||
|
||||
/* 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 */
|
||||
FileOffset.u.HighPart = 0;
|
||||
|
|
Loading…
Reference in a new issue