Hi all,
I am trying to create a reparse point in NTFS that points to my file system,
so that it can be mounted inside C: instead of its own drive letter. My
file system is virtual, it has no VDOs or VPBs. It has one CDO named
“\Pifs”, and a symbolic link that points to it: “\GLOBAL??\PiFS” –>
“\Pifs”. I am running on XP SP2.
The threads on this mailing list wrt reparse points are about implementing
reparse points in custom FSD filters, but I am not interested in that as
much. The documentation on “Microsoft style” reparse points is sparse an
incomplete it seems, but I found a few link on the web, the best of which is
this:
http://www.sysinternals.com/Utilities/Junction.html
With this tool, I can create a junction like this:
junction.exe C:\temp\mnt\ “C:\Program Files”
which works correctly. Trying to create a junction to my file system
generates the infamous “The data present in the reparse point buffer is
invalid”.
Looking at the junction code, it declares its own data structure
REPARSE_MOUNTPOINT_DATA_BUFFER which it passes to
DeviceIoControl(FSCTL_SET_REPASE_POINT). It always prepends "??" to the
link target, and strips off the trailing "" iff the second last character
is a “:”.
I modified the code to not do the link target manipulations to allow me more
room for experimentation. I tried the following:
Junction c:\temp\mnt\ \Pifs // nope
Junction c:\temp\mnt\ ??\Pifs // uh-un
Junction c:\temp\mnt\ \?\Pifs // please try again
Junction c:\temp\mnt\ ????\Pifs // no way
Junction c:\temp\mnt\ \???\Pifs // you’re kidding right?
All fail in one of two ways. The first way is with the invalid buffer
message. The second way works when calling DeviceIoControl(), but says
directory not found when I do “dir c:\temp\mnt”.
Again in the junction code, I noticed that it handles a reparse tag of
0x80000000|IO_REPARSE_TAG_SYMBOLIC_LINK when displaying the reparse
information for a directory. I modified the code to use this instead of
IO_REPARSE_TAG_MOUNT_POINT when creating a junction, but it did not help
(DeviceIoControl succeeded, but dir failed).
Is there a way to create a reparse point in NTFS so that it acts just like
an object manager symbolic link? If so, what is the structure to pass to
DeviceIoControl() and how do you fill in the fields? I can create drive
letter symbolic links, like “\GLOBAL??\P:” –> “\Pifs” and that works fine.
Thanks.
=================================================
Roger Tawa
http://tawacentral.net/
[One thing about paradigms: shift happens.]
[When you stop, you’re done.]