Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Redirection Between Volumes

cc_vvcc_vv Member Posts: 3

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!

Comments

  • ntdeveloper31ntdeveloper31 Member Posts: 43

    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

  • cc_vvcc_vv Member Posts: 3

    @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

  • ntdeveloper31ntdeveloper31 Member Posts: 43

    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.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA