Help in Volume Bitmap

Hi,

I have developed an upper volume filter driver which is working like a charm, it tracks the sectors that are modified. I have used diskperf sample as the base.
Now I want this filter driver to create our own bitmap that would represent volume blocks that have changed vs unchanged, but I am stuck over here, not getting where to start from, can any one give some input for this. Is there any sample code available in the sdk that implements bitmap or which function can be used to implement the same?
Any kind of help appreciated.

Thanks in advance.

In the WDK take a look at RtlInitializeBitMap, and the referenced
routines at the bottom.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

xxxxx@yahoo.com” wrote in message
news:xxxxx@ntdev:

> Hi,
>
> I have developed an upper volume filter driver which is working like a charm, it tracks the sectors that are modified. I have used diskperf sample as the base.
> Now I want this filter driver to create our own bitmap that would represent volume blocks that have changed vs unchanged, but I am stuck over here, not getting where to start from, can any one give some input for this. Is there any sample code available in the sdk that implements bitmap or which function can be used to implement the same?
> Any kind of help appreciated.
>
> Thanks in advance.

The simpliest way is to create your own bitmap file on the tracked volume. Open the bitmap file exclusively in your volume filter. No caching mode. When any cluster is modified, mark Irp as pending, then just set the required bit or byte in your bitmap file, then complete Irp.

If the bitmap file is opened in non-exclusive mode, then any application can corrupt your bitmap data. The problem here that another application can’t open the tracked volume exclusively. So if you run chkdsk utility for the tracked volume you’ll get access error.

You can also store bitmap data on another volume or disk.