Hi everyone.
I added an extra extension (e.g., .encrypt") to a new created file in PreCreate. Then I hid the extra extension in PostDirectoryControl, and PostQueryInformation.
The issue is: the General Properties are not correct, for example:
Size: 0 bytes;
Size on disk: 0 bytes;
Created: (blank)
Modified: (blank)
Accessed: (Blank)
But the Details tab in the Properties are correct (size, date created, modified).
I dealt with all the 6 cases in QueryDirectory of Directory Control, as well as IRP_MJ_QUERY_INFORMATION.
Maybe I overlook something. Could anyone please give me some advice? Has anyone encountered this issue before?
Thanks in advance!
have you walked the IRP_QUERY_FILE_INFORMATION in the debugger?
Run Process Monitor. Compare a working case with your non-working case. Be prepared to do this day in and day out for as long as you are developing and supporting your product.
Welcome to your new life!
-scott
OSR
@OSRDrivers
Hi Rod, thanks for your replay.
>have you walked the IRP_QUERY_FILE_INFORMATION in the debugger?
Yes, I walked through the IRP_MJ_QUERY_INFORMATION and the file size information were correct, in FileAllInformation, FileNetworkOpenInformation, FileStandardInformation.
I have not dealt with “GenerateFileName” routine. Maybe I need to finish this routine first.
Thanks Scott.
>Run Process Monitor. Compare a working case with your non-working case. Be
prepared to do this day in and day out for as long as you are developing and
supporting your product.
I downloaded the Process Monitor and used it for a while. It is very useful. Thanks.
>Welcome to your new life!
Thank you! Haha, minifilter development is very interesting. I can do some magic things with it.
Thanks everyone.
I found the source of the problem. in IRP_MJ_DIRECTORY_CONTROL, the IoStatus.Status returned “STATUS_NO_SUCH_FILE” when queried FileName “abc.txt” which real name on disk was “abc.txt.encrypt”.
I think that is the point.
Thanks.
Hi All, I solved the problem. The virtual file name “abc.txt” should be change to its real name “abc.txt.encrypt”, otherwise, the name was invalid.
Thanks for Rod and Scott’s reply.