Hi all,
In my minifilter encrypted driver,file be encrypted in POS_CLOSE
routine,and decrypt in POS_READ routin.It works fine with most apps.But when
it works wiht MS word/excel,it cause them report error ruleless.
I have tried all places below:
1.Encrypted file in PRE_CLEANUP,and read/write file use
FltReadFile/FltWriteFile with original File Object.
2.Encrypted file in POS_CLEANUP,and read/write file use
FltReadFile/FltWriteFile with original File Object.
3.Encrypted file in POS_CLOSE,and read/write file use
FltReadFile/FltWriteFile with Self File Object(Got the file full name in
Pos_Create and use FltCreateFile open the file).
If encrypt routin can’t got original File Object(after close),it will open
the file by self(With the file name got from Pos_Create),then pending the
IRP and encrypt file (use FltQueueDeferredIoWorkItem).
All read/write with out Lock operation,and the open file parameter(in
Pos_Close,Self Open) is:
status = FltCreateFile( MyDriver.Filter,
p2pCtx->SCtx->Instance,
&FHandle,
GENERIC_READ | GENERIC_WRITE,
&OAtt,
&IOSB,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,//FILE_SHARE
FILE_OPEN,
FILE_NO_INTERMEDIATE_BUFFERING,
NULL,
0,
IO_FORCE_ACCESS_CHECK);
Encryption use cached read,NON_CACHED write.
All these operating will cause word/excel report error ruleless,and works
fine with most other apps.(Such as autocad,acdsee…etc)
Where is the best encrypt place? Or my encrypting operating is wrong?
Thanks!
=============================
Murphy W.(CHN)