Redirection Between Volumes

hello everyone,
This may be a simple mistake, but I could not find the reason.
Microsoft’s demo simrep redirects the operation of the same volume’s \Device\HarddiskVolume4\x\y directory to \Device\HarddiskVolume4\a\b, now I change it to The form that can be cross-volume is also like \Device\HarddiskVolume4\x\y to \Device\HarddiskVolume3\a\b.
Now I don’t want to redirect only the files in a specific directory, but redirect all operations of the E: disk to the D: disk, including the root directory, I originally thought that I just need to replace the previous volume name part when I call the ReplaceFileNameFunction, but the situation seems not so simple, I don’t know what went wrong.
By the way, the volume that I really want to redirect is not a physical volume, it is virtual, its volume name is \Device\Mup, the root directory is \; WinFsp.Mup\memfs64\share2, which is specific to The directory redirection is successful (that is, \Device\HarddiskVolume4\x\y to \Device\Mup\;WinFsp.Mup\memfs64\share2\a\b), so I don’t think the problem is related to this…

thanks!

Yes, you just need to change the filename (new filename should be absolute path including new volume name etc.) in the TargetFileObject using IoReplaceFileName function and do the usual reparsing stuff. Having said that there are number of scenarios / edge cases that needs special handling, e.g. rename operation, directory enumeration etc.

Perhaps if you can share what exactly is not working - that would help us to understand your problem.

thanks

@ntdeveloper31 said:
Yes, you just need to change the filename (new filename should be absolute path including new volume name etc.) in the TargetFileObject using IoReplaceFileName function and do the usual reparsing stuff. Having said that there are number of scenarios / edge cases that needs special handling, e.g. rename operation, directory enumeration etc.

Perhaps if you can share what exactly is not working - that would help us to understand your problem.

thanks

thank you for your repley.
This is just my mistake,This is a bug
Logic is correct, In fact, According to me, Not only need to change the file name in the TargetFileObject, but also change the TargetInstance

Logic is correct, In fact, According to me, Not only need to change the file name in the TargetFileObject, but also change the TargetInstance
I don’t think so. Just changing the name in TargetFileObject should be enough as long as its an absolute path.