Status = STATUS_INSUFFICIENT_RESOURCES;
goto ByeBye;
}
- Ccb = ExAllocatePoolWithTag (NonPagedPool, sizeof (VFATCCB), TAG_CCB);
+ Ccb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);
if (Ccb == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
DbgPrint ("CcRosInitializeFileCache failed\n");
goto ByeBye;
}
- DeviceExt->LastAvailableCluster = 0;
+ DeviceExt->LastAvailableCluster = 2;
ExInitializeResourceLite(&DeviceExt->DirResource);
ExInitializeResourceLite(&DeviceExt->FatResource);
VolumeFcb->pDevExt = (PDEVICE_EXTENSION)DeviceExt->StorageDevice;
DeviceExt->VolumeFcb = VolumeFcb;
+ ExAcquireResourceExclusiveLite(&VfatGlobalData->VolumeListLock, TRUE);
+ InsertHeadList(&VfatGlobalData->VolumeListHead, &DeviceExt->VolumeListEntry);
+ ExReleaseResourceLite(&VfatGlobalData->VolumeListLock);
+
/* read serial number */
DeviceObject->Vpb->SerialNumber = DeviceExt->FatInfo.VolumeID;
if (DeviceExt && DeviceExt->FATFileObject)
ObDereferenceObject (DeviceExt->FATFileObject);
if (Fcb)
- ExFreePool(Fcb);
+ vfatDestroyFCB(Fcb);
if (Ccb)
- ExFreePool(Ccb);
+ vfatDestroyCCB(Ccb);
if (DeviceObject)
IoDeleteDevice(DeviceObject);
if (VolumeFcb)