The Question of encrypting the DOC files

Hi, Everybody!
I am writing a DOC files encrypt filter driver

Here is my method:

1.when saving a file a.doc, the WINWORD temp file will rename
to a.doc through IRP_MJ_SET_INFORMATION, I catch the doc filename and
began static encrypt a.doc.(create a new file a.doc.temp, and encrypt a.doc to a.doc.temp)
2.when a IRP_MJ_CLOSE sent to a.doc, I create a system thread after IRP_MJ_CLOSE,the thread is use to delete a.doc, rename a.doc.temp to a.doc)

My problem is that when I delete the doc file,the Syetem said I have no permission!.

Nan Chen