Hi,
I developed a minifilter driver that add header to office files.
I add the header in the pre-cleanup operation.
I have a problem with the way office applications do the save.
I understand (from other posts and procmon) that what happen is:
- orig file rename to xxx.tmp
- file is written in another tmp file (in some office its .tmp in other its without extension)
- the secondary file is being rename into the orig file name (.doc, .docx …)
My problem is that the secondary tmp file is without my header (I guess because the office application doesn’t see my header) and when the (3) rename happen my header is lost.
I tried to put it back in two different places but both are causing weird problems with the office.
- first place I tried in the SET_INFORMATION when the tmp file is renamed to the orig file name I added it to the tmp file. This way the orig file will get the header. This method work in most cases but cause weird timing/sharing violations in office.
- Second place I tried to add it to the tmp file when it is closed. This also failed with same weird errors (some times)
What is the best place to re-add the header?
Is there a method to make it stay?
The rename operation is the first place that I actually know that this tmp file is my original doc file and is going to be renamed to it.
Thanks,
Sagi