STATUS_REPARSE

hi guys
i have used STATUS_REPARSE to redirect file to other location.
also i used PostDirectoryQuery to inject a fake file entry into result.
anything is OK, (include dir command from CMD, and also the explorer).
but when i use “attrib” command from “CMD” (or call GetFileAttributes API).
if i target the “Drive C” , anything is working… but if i try fake file in “Drive E”, even PreCreateFile is not called!!! to let me redirect.
could you guess what is problem?

If you filter volume “E” then you should receive pre-create callback (check
!fltkd.volumes if your filter is really attached to this volume). Prior to
Win7/Win8 it’s not possible to return STATUS_REPARSE with a filepath on
different volume that the requested operation (see [1] for more details
about reparsing on Win7+). Sometimes it’s easier to handle
PreDirectoryQuery, return your own entries + complete IRP and then filter
PostDirectoryQuery, otherwise you would have to deal with already returned
entries from filesystem and inject your entries to the buffer, which may be
small, etc.

[1]
http://fsfilters.blogspot.cz/2012/02/reparsing-to-different-volume-in-win7.h
tml

Hi Petr,
thanks for your answer.

Windows is 10x64
my current scenario is:
my target file (the file which any file should redirect to it) is located at drive “E”.
Open file from “any drive” (C or E) will direct correctly to new file on E drive.
no problem from OPEN File. the problem is just the “GetFileAttributesW” API, or attrib command on “CMD”.
also i have checked another scenario:
i selected a target file from drive “C”, again same problem exist… get Calling GetFileAttributes api dont call OpenFile, so there is no IRP_MJ_CREATE.
i thing we should “GetFileAttribute” API in special way.
may be i should also implement “other thing” that i have missed.

You should try with IRP_MJ_DIRECTORY_CONTROL.
If it does not get called, then try using a tool like Sysinternals’ process monitor and check what is being missed.

Hi Guys, the Problem Solved.
i should also implement IRP_MJ_NETWORK_QUERY_OPEN
and disallow FastIO Operation on my target file. (because no status_reparse is possible in FastIO mode).