problem

hi all,

I am trying to modify the Ramdisk sample to make it a persistant drive.

Simply speaking, I save the contents of the memory buffer as a dump file and
reload it at boot time again.

The devExt->DiskImage parameter has the image of the disk.

However Ramdisk also (at start time) processes the registry and repopulates
the root dir and fat entries again, since it is not supposed to be
persistant. i made the followinf modifications in the code, but still my
data gets flushed. I simply cannot get the old data back. Any suggestions
please.

I do not do a RtlZeroMemory( devExt->DiskImage,
devExt->DiskRegInfo.DiskSize); in case of a disk file found.

i do not re set the root dir entires field in caxse of a disk file

if(!Diskfile)
bootSector->bsRootDirEnts = (USHORT)rootDirEntries;
else{
rootDirEntries= bootSector->bsRootDirEnts;
devExt->DiskRegInfo.RootDirEntries= bootSector->bsRootDirEnts;

}

I force not to over write the first fat sectors with -1 in case of a disk
file

if(!Diskfile){
KdPrint((ā€œ\nThis is a new drive so reset FAT\nā€));
firstFatSector[1] = 0xFF;
firstFatSector[2] = 0xFF;

if (fatType == 16) {
firstFatSector[3] = 0xFF;
}
}

The images is created correctly, however, I cannot read back my data, and
the root dir is always empty. Any suggestions.

One more thing, I dont write portions of the file, every time there is an
IRP_MJ_WRITE op, I dumop the entrire image, this is because teh Rdisk is too
small in my case to do further optimizations.

AP