Accessing the user data...

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 page locks. How can I solve this problem.

Other doubt is, is it possible to update the registry at boot time?

Thanks in advance

Ashish Maliye

>Right now I just want to increase the stored value by one (ASCII value). I
am

doing the following.
StoreUserMdl = Irp -> MdlAddress;

Do not touch the MDL allocated for you by the IO manager. Allocate your
own and copy the data to it. In the completion routine, free your MDL and
restore the IO manager’s one.

Max

Hi Max,
Thank you for your valuable suggestion. Actually, I want to encrypt the
data while writing on the disk, and decrypt it on reading. For the time
being I just want to increment the value by one while writing on the disk
and on reading decrement the value by one. How can I update the data stored
in the user buffers described by MDL.

Ashish Maliye

-----Original Message-----
From: Maxim S. Shatskih
To: File Systems Developers
Date: Tuesday, April 04, 2000 2:39 PM
Subject: [ntfsd] Re: Accessing the user data…

>>Right now I just want to increase the stored value by one (ASCII value). I
>am
>>doing the following.
>>StoreUserMdl = Irp -> MdlAddress;
>
>Do not touch the MDL allocated for you by the IO manager. Allocate your
>own and copy the data to it. In the completion routine, free your MDL and
>restore the IO manager’s one.
>
> Max
>
Original Message-----
From: Amit Gorantiwar
To: File Systems Developers
Date: Tuesday, April 04, 2000 1:35 PM
Subject: [ntfsd] Accessing the user data…

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 page locks.
How can I solve this problem.

Other doubt is, is it possible to update the registry at boot time?

Thanks in advance

Ashish Maliye
>

> in the user buffers described by MDL.

Map them to system space and play with them.

Max