The function CcUninitializeCacheMap fall into a dead loop.It does not respond

  • Thread starter Thread starter OverflowAtMsdn
  • Start date Start date
O

OverflowAtMsdn

Guest
PACKED_BOOT_SECTOR gBootSector;
PVOID ptrBootSector = &gBootSector;

LARGE_INTEGER FatMaxLarge = { MAXULONG,MAXLONG };

pVolDev->fileObject->SectionObjectPointer = &Vcb->SectionObjectPointers;;
pVolDev->fileObject->WriteAccess = TRUE;
pVolDev->fileObject->ReadAccess = TRUE;
pVolDev->fileObject->DeleteAccess = TRUE;
HrfsData.gVolume.nodeType = HRFS_NTC_VCB;
pVolDev->fileObject->FsContext = &HrfsData.gVolume;
pVolDev->fileObject->Vpb = Vpb;

Vcb->TargetDeviceObject = TargetDeviceObject;

fileSize.AllocationSize.QuadPart = fileSize.FileSize.QuadPart = 4*1024;
fileSize.ValidDataLength = FatMaxLarge;
ClearFlag(pVolDev->DeviceObject.Flags, DO_DEVICE_INITIALIZING);
Vpb->DeviceObject = &pVolDev->DeviceObject;
CcInitializeCacheMap(pVolDev->fileObject,
&fileSize,
TRUE,
&HrfsData.CacheManagerNoOpCallbacks,
Vcb);

Vbo.QuadPart = 4*1024;

if (!CcMapData(VirtualVolumeFile,
&Vbo,
ByteCount,
BooleanFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT),
Bcb,
Buffer)) {

ASSERT(!FlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT));


FatRaiseStatus(IrpContext, STATUS_CANT_WAIT);
}

DbgPrint("Finished HrfsMapVolumeFile for BootSector\n");

DumpBootSector(ptrBootSector);
char* outPut = (char*)ptrBootSector;
for (int i = 0; i < sizeof(PACKED_BOOT_SECTOR); i++)
DbgPrint("0x%.2x\n", outPut);
LARGE_INTEGER truncateSize;
truncateSize.QuadPart = sizeof(PACKED_BOOT_SECTOR);
CcUninitializeCacheMap(pVolDev->fileObject, NULL, NULL);
The CcInitializeCacheMap and CcMapData all work well .But when I call CcUninitializeCacheMap It failed into a dead loop

Continue reading...
 
Back
Top