if (vfatFCBIsDirectory(pFCB))
{
/* Uninitialize file cache if initialized for this file object. */
- if (pFCB->RFCB.Bcb != NULL)
+ if (pFCB->FileObject->SectionObjectPointers->SharedCacheMap)
{
- CcRosReleaseFileCache(pFCB->FileObject, pFCB->RFCB.Bcb);
+ CcRosReleaseFileCache(pFCB->FileObject);
}
vfatDestroyCCB(pFCB->FileObject->FsContext2);
pFCB->FileObject->FsContext2 = NULL;
+ pFCB->FileObject->FsContext = NULL;
ObDereferenceObject(pFCB->FileObject);
}
vfatDestroyFCB (pFCB);
Index = pFCB->Hash.Hash % FCB_HASH_TABLE_SIZE;
ShortIndex = pFCB->ShortHash.Hash % FCB_HASH_TABLE_SIZE;
KeAcquireSpinLock (&pVCB->FcbListLock, &oldIrql);
- pFCB->pDevExt = pVCB;
InsertTailList (&pVCB->FcbListHead, &pFCB->FcbListEntry);
pFCB->Hash.next = pVCB->FcbHashTable[Index];
fileObject->Flags |= FO_FCB_IS_VALID | FO_DIRECT_CACHE_PAGING_READ;
fileObject->SectionObjectPointers = &fcb->SectionObjectPointers;
- fileObject->FsContext = (PVOID) &fcb->RFCB;
+ fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
- newCCB->pFcb = fcb;
- newCCB->PtrFileObject = fileObject;
fcb->FileObject = fileObject;
- fcb->pDevExt = vcb;
fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ?
vcb->FatInfo.BytesPerCluster : PAGE_SIZE;
status = CcRosInitializeFileCache (fileObject,
- &fcb->RFCB.Bcb,
fileCacheQuantum);
if (!NT_SUCCESS (status))
{
CurrentCluster = FirstCluster = pVCB->FatInfo.RootCluster;
FCB->entry.FirstCluster = FirstCluster & 0xffff;
FCB->entry.FirstClusterHigh = FirstCluster >> 16;
- CurrentCluster = FirstCluster;
while (CurrentCluster != 0xffffffff && NT_SUCCESS(Status))
{
fileObject->Flags = fileObject->Flags | FO_FCB_IS_VALID |
FO_DIRECT_CACHE_PAGING_READ;
fileObject->SectionObjectPointers = &fcb->SectionObjectPointers;
- fileObject->FsContext = (PVOID) &fcb->RFCB;
+ fileObject->FsContext = fcb;
fileObject->FsContext2 = newCCB;
- newCCB->pFcb = fcb;
- newCCB->PtrFileObject = fileObject;
- fcb->pDevExt = vcb;
DPRINT ("file open: fcb:%x file size: %d\n", fcb, fcb->entry.FileSize);
return STATUS_SUCCESS;