word tmp file encrypt problem?

I want encrypt word tmp file ~wrd*.tmp file, buf when save file winword prompt for “memory or disk space not enough”. Someone may help me?
I add some information at the head of tmp file when it’s created, and encrypt the data of
tmp file content at fly. One strange situation is after IRP_MJ_CLOSE,
system issues IRP_MJ_WRITE (IRP_SYNCHRONOUS_PAGING_IO), the
fcb’s sizes are zero(filesize, validdatalength and allocation size). But when I don’t encrypt the tmp file, it’s size here is correct!
My filter driver is based on FileMon and works well for notepad and wordpad.

And in Filemon, I notices all IRP returned NT_SUCCESS

hi,
Do you have unexpected characters at the end of the file when you opened
it by Notepad? I add the encrypt header at the begin of the file, but I have
the unexptected characters at the end of the file!The strange situation is
becasue the Lazy_writer thread! Are you chinese? My Oicq: 12781177, Nice to
meet you!

2006/9/13, xxxxx@yahoo.com.cn :
>
> I want encrypt word tmp file ~wrd*.tmp file, buf when save file winword
> prompt for “memory or disk space not enough”. Someone may help me?
> I add some information at the head of tmp file when it’s created, and
> encrypt the data of
> tmp file content at fly. One strange situation is after IRP_MJ_CLOSE,
> system issues IRP_MJ_WRITE (IRP_SYNCHRONOUS_PAGING_IO), the
> fcb’s sizes are zero(filesize, validdatalength and allocation size). But
> when I don’t encrypt the tmp file, it’s size here is correct!
> My filter driver is based on FileMon and works well for notepad and
> wordpad.
>
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

to Steven David:
no. notepad and wordpad work well. this problem occurs only when I encrypt word tmp file.