No Encrypt data wrote to physical disk??

I use sfilter’s frame to create a Transparent Encryption Driver.
But ,a big problem.
if I create Encrypt folder in C:\
like this: "C:\EncryptFiles"
this is a path that which need to Encrypt.
here is my code:

if(Myirpsp->MajorFunction == IRP_MJ_WRITE &&
(pIrp->Flags & (IRP_PAGING_IO|IRP_SYNCHRONOUS_PAGING_IO|IRP_NOCACHE)))
{
…Encrypt Data
}

when I copy a file to folder
the file can be encrypt
but when I create file in this folder
“1.txt” and edit it .save it .
the data is not encrypt
and when i reboot my computer
I find out the copied file is right?
but …edited file’s data is error.is encrypted!
someont told us “hey,you need flush system Buffer”
I don’t know how to do it .
is there any other way to solve this problem???
or my friend’s word is right???

thanks for everyone