Hello Gurus
I am writing a File System filter driver having Encrypt/Decrypt. I am using
filemon as an example code.
In order to solve the memory mapped file issue i have created a new
structure of FCB.
In that FCB i had specified the structure of FSRTL_COMMON_FCB_HEADER ,
SECTION_OBJECT_POINTERS and ERESOURCE for
MainResource and PagingResource.
After creating this I initialize the FSRTL_COMMON_FCB_HEADER to my
fileobject->FsContext and fileobject->SectionObjectPointer to my new
SectionObjectPointer. My new SectionObjectPOinter has all the 2 members
namely the Data,Image set to NULL. I also initialize the MainResource and
PagingResource using ExInitializeResourceLite.
I do this in my IRP_MJ_CREATE and when i recv a IRP_MJ_CLEANUP i traverse my
list for my SectionObjectPOinter and then delete the corresponding
FSRTL_COMMON_FCB_HEADER that i had allocated. Actually i keep both the
sectionobjectpointer and COmmonFCBHeader in a Link list from which i
traverse and delete it.
I actually got this by referring some of the posts in this forum. But i know
i am missing something because it does not work yet. If i create a rich text
document and then edit it and type in some new contents and then open it
again i get the garbled text i mean the encyrpted text. the same thing
happens for bmp files as well. When i click it again i get the IRP_MJ_READ
with CACHE set.Hence my ReadWrite Handler does not decyrpt it as its from
the Cache. But still it displays as Encrypted.
Any Hints on where i can be going wrong is greatly appreciated.
Thanks and Best Regards
Shal.