virtual disk driver - volume header

I am writing a virtual disk driver which uses a file as a virtual disk. The disk file can be mounted with a drive letter and normally used. Internally, ZwReadFile and ZwWriteFile in the dispatch routine for IRP_MJ_READ and _WRITE do the job to write on and read from “disk”. As far, everything works fine.
Now, I would like to write a volume header sector at the beginning of the disk file. This volume header sector should not be formatted by e.g. the windows format command. I think I have to modify the StartingOffset of the VERIFY_INFORMATION of IOCTL_DISK_VERIFY and shift as well the offest of IRP_MJ_WRITE to save this special sector for overwriting? Until now, the windows format begins at StartingOffset 0 and thus, overwrites my volume header sector which was written when the file was created. Any help would be gratefully appreciated. More info can be provided if applied.

Yes you must shift the offset of read/write.
For IOCTL_DISK_VERIFY try to set
Irp->IoStatus.Information=0;
status=STATUS_SUCCESS;
and nothing more. It means don’t modify disk file on IOCTL_DISK_VERIFY.

Andrey Gunko
soft Xpansion Ukraine Ltd.
Programmer
Powered by eKnow-how
Artjoma St. 118B … 83048 Donetsk … Tel/Fax: +38 062 3818874 …
Internet: [www.soft-xpansion.com]

|-----Original Message-----
|From: xxxxx@lists.osr.com [mailto:bounce-265688-
|xxxxx@lists.osr.com] On Behalf Of xxxxx@fair-computer.de
|Sent: Tuesday, October 10, 2006 9:12 PM
|To: Windows File Systems Devs Interest List
|Subject: [ntfsd] virtual disk driver - volume header
|
|I am writing a virtual disk driver which uses a file as a virtual disk. The
|disk file can be mounted with a drive letter and normally used. Internally,
|ZwReadFile and ZwWriteFile in the dispatch routine for IRP_MJ_READ and
|_WRITE do the job to write on and read from “disk”. As far, everything
|works fine.
|Now, I would like to write a volume header sector at the beginning of the
|disk file. This volume header sector should not be formatted by e.g. the
|windows format command. I think I have to modify the StartingOffset of the
|VERIFY_INFORMATION of IOCTL_DISK_VERIFY and shift as well the offest of
|IRP_MJ_WRITE to save this special sector for overwriting? Until now, the
|windows format begins at StartingOffset 0 and thus, overwrites my volume
|header sector which was written when the file was created. Any help would
|be gratefully appreciated. More info can be provided if applied.
|
|—
|Questions? First check the IFS FAQ at
|https://www.osronline.com/article.cfm?id=17
|
|You are currently subscribed to ntfsd as: xxxxx@maus.donetsk.ua
|To unsubscribe send a blank email to xxxxx@lists.osr.com