Help regarding filter driver..

Hi Friends,

Thanks again for helping me. Now I am able to update the data of the MDL.

I referred Disk Performance monitor to develop my filter driver. As I sad I want to encrypt the data while writing and decrypt the data on reading. I observed driver is trapping the read and write request to the disk. Problem is there is some inconsistency between the read and write request.

Suppose I want to open a file from a drive on the very first time driver gets read request, but next time if I want to open the same file it is not getting any request. But every time I want to save the file, driver gets the write request. How can I eliminate this inconsistency , which is creating a great problem for doing encryption and decryption properly.

Hello friends,

I had written a small filter driver. Which is attached to all the partitions of the hard disk. Driver is receiving all the read and write request to the disk. Now I want to update the use data. I set device object flag to DO_DIRECT_IO. Right now I just want to increase the stored value by one ASCII value. I am doing the following.

StoreUserMdl = Irp -> MdlAddress;

while ( StoreUserMdl != NULL )

{

UserData = (PCHAR) ( * (PCHAR) StoreUserMdl -> StartVa + StoreUserMdl -> ByteOffset );

if ( irpStack -> MajorFunction == IRP_MJ_WRITE )

for ( Count = 0; Count <= StoreUserMdl -> ByteCount; Count ++ )

++ * ( UserData + Count );

StoreUserMdl = StoreUserMdl -> Next;

}

On loading driver page fault occurs. I think it is because of some page locks. I am not very clear about the MDL mechanism, and also not very confident with my approach. Is it a correct way of accessing the user data? or I have to do some thing else.

how to set FILE_NO_BUFFERING from a filter driver?

Ho Mun Chuen
@@ “Not everything that counts can be counted;
<” )~ and not everything that can be counted counts"
//\ … Albert Einstein
----- Original Message -----
From: Giga Giguashvili
To: File Systems Developers
Sent: Tuesday, April 18, 2000 3:00 AM
Subject: [ntfsd] Re: Help regarding filter driver…

Hi,

Your problem is called buffering. After the system reads data from the
file, on furhter requests, processes
get the cached data. On writes, dirty pages get flushed to the file,
that’s why saving file causes writes.

I don’t know an effective solution for this problem, but assuming you
encrypt only small amount of
files on the disk, you may open files with FILE_NO_BUFFERING option.

Regards,
Giga

Amit Gorantivar wrote:

Hi Friends,

Thanks again for helping me. Now I am able to update the data of the
MDL.

I referred Disk Performance monitor to develop my filter driver. As I
sad I want to encrypt the data while writing and decrypt the data on
reading. I observed driver is trapping the read and write request to the
disk. Problem is there is some inconsistency between the read and write
request.

Suppose I want to open a file from a drive on the very first time driver
gets read request, but next time if I want to open the same file it is
not getting any request. But every time I want to save the file, driver
gets the write request. How can I eliminate this inconsistency , which
is creating a great problem for doing encryption and decryption
properly.

Hello friends,

I had written a small filter driver. Which is attached to all the
partitions of the hard disk. Driver is receiving all the read and write
request to the disk. Now I want to update the use data. I set device
object flag to DO_DIRECT_IO. Right now I just want to increase the
stored value by one ASCII value. I am doing the following.

StoreUserMdl = Irp -> MdlAddress;

while ( StoreUserMdl != NULL )

{

UserData = (PCHAR) ( * (PCHAR) StoreUserMdl -> StartVa + StoreUserMdl ->
ByteOffset );

if ( irpStack -> MajorFunction == IRP_MJ_WRITE )

for ( Count = 0; Count <= StoreUserMdl -> ByteCount; Count ++ )

++ * ( UserData + Count );

StoreUserMdl = StoreUserMdl -> Next;

}

On loading driver page fault occurs. I think it is because of some page
locks. I am not very clear about the MDL mechanism, and also not very
confident with my approach. Is it a correct way of accessing the user
data? or I have to do some thing else.