IRP_SET_INFORMATION and my approach

Some might feel more like answering your question if you didn’t have html tags in your message.
“ganesh pashupathi” wrote in message news:xxxxx@ntfsd…
Hi,

I am not sure of what I am doing is right in this case. Please comment on my approach.

As per my previous posts I insert a header in a file and also the file data is encrypted. There are two places where I can modify the file size . 1) IRP_MJ_WRITE and 2) IRP_MJ_SET_INFORMATION without paging i/o flag set.

In some applications when the file is written to, the paging write is seen first. I encrypt the data out here. But I cannot insert my header here since I cannot modify the file size in the paging write.

Next I see a non paging IRP_MJ_SET_INFORMATION. Now what I do is I read the entire contents of the file, then insert my header and next write the contents back into the file. This seems to be a cumbersome process. I think I am doing something wrong out here.

~ganesh