[FASTFAT]

- Store IO VPB in our VCB for later use
- Prepare a spare VPB in our VCB for dismount swapout

svn path=/trunk/; revision=65361
This commit is contained in:
Pierre Schweitzer 2014-11-10 17:42:51 +00:00
parent 0343b8c5b5
commit f00ed8906d
2 changed files with 14 additions and 0 deletions

View file

@ -521,6 +521,14 @@ VfatMount(
/* Initialize this resource early ... it's used in VfatCleanup */
ExInitializeResourceLite(&DeviceExt->DirResource);
DeviceExt->IoVPB = DeviceObject->Vpb;
DeviceExt->SpareVPB = ExAllocatePoolWithTag(NonPagedPool, sizeof(VPB), TAG_VFAT);
if (DeviceExt->SpareVPB == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
goto ByeBye;
}
DeviceExt->FATFileObject = IoCreateStreamFileObject(NULL, DeviceExt->StorageDevice);
Fcb = vfatNewFCB(DeviceExt, &NameU);
if (Fcb == NULL)
@ -622,6 +630,8 @@ ByeBye:
/* Cleanup */
if (DeviceExt && DeviceExt->FATFileObject)
ObDereferenceObject (DeviceExt->FATFileObject);
if (DeviceExt && DeviceExt->SpareVPB)
ExFreePoolWithTag(DeviceExt->SpareVPB, TAG_VFAT);
if (Fcb)
vfatDestroyFCB(Fcb);
if (Ccb)

View file

@ -299,6 +299,10 @@ typedef struct DEVICE_EXTENSION
/* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
ULONG OpenHandleCount;
/* VPBs for dismount */
PVPB IoVPB;
PVPB SpareVPB;
} DEVICE_EXTENSION, VCB, *PVCB;
typedef struct