windows.GetFinalPathNameByHandle: Support volumes mounted as paths #19738
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A volume can be mounted as a NTFS path, e.g. as C:\Mnt\Foo. In that case, IOCTL_MOUNTMGR_QUERY_POINTS gives us a mount point with a symlink value something like
\??\Volume{383da0b0-717f-41b6-8c36-00500992b58d}. In order to get theC:\Mnt\Foopath, we can query the mountmgr again using IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH.Fixes #19731
Zig installed to a VHD mounted as a path:
Before:
After:
Note: It's also possible for a volume to be mounted to multiple paths. This PR will currently always just return the first one--unsure how something like
GetVolumePathNameWcompares, need to test that.