I have developed a Windows 2000 filter driver which does all of its
functions correctly except for when it is suppose to encrypt the data
being written to the “filtered” drive.
The driver intercepts the MajorFunction[IRP_MJ_WRITE], when it determines
that encryption is needed, it allocates its own data buffer from the non-
paged pool, copies the user data to this buffer, performs the encryption,
updates the IRP to use this buffer, sets a completion routine, and passes
the IRP down via IoCallDriver. Then, when the completion routine is
called, it frees the data buffer that it allocated for writing the
encrypted data, and restores the IRP UserBuffer and MdlAddress values with
the original ones which it had saved off.
This all seems to work just fine, but somehow the OS knows I have mucked
with the user data and sends another IRP for the exact same portion of
file data, but this time it sends me a copy of the encrypted data which I
just got done writing!
How do I prevent the OS from doing this multiple write when I am trying to
do data encryption?
Thanks,
Doug