Redirect Filter

I am new to minifilter development and thank you in advance for your help. I searched and read previous posts for several days and made some progress. However, there are still unsolved issues. There were some posts about similar questions but no answer :frowning:

Object: Create a minifilter to redirect all visit to \Disk1\dir1 to \Disk2\dir2

Solution so far: monitor IRP_MJ_CREATE, match file name. if matched, rewrite the targetfileobject, change state to STATUS_REPARSE, information ot IO_REPARSE and return FLT_PREOP_COMPLETE.

It works for may operations, such as open a file, read/write. But there are three problems:

  1. In cmd window, cd \Disk1\dir1 (suppose to go to \Disk2\dir2) but failed.
  2. In Explorer window, try to rename a file in \Disk1\dir1, but failed (For this one, I also monitor IRP_MJ_SET_INFORMATION and change InfoBuffer if detect rename operation, but no luck)
  3. If there is a subfolder is \Disk2\dir2, from explorer window I can enter the folder from \Disk1\dir1 (redirect OK), but I can not open any files in it.

There are at least 5 similar posts about these issues, but got no answer. Can someone help me on this. I stuck in this point for quite long already.

Changing TargetFileObject doesn’t help if you don’t plan to let the IO continue. If you plan to complete it with STATUS_REPARSE, you need to update the name (see

TargetFileObject is useful when you want to redirect an operation to a different FILE_OBJECT so you just change the FILE_OBJECT on the way down and let the operation continue.

This posting is provided “AS IS” with no warranties, and confers no rights.