Skip to content

FileManager: correct API misuse on Windows #3049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2021
Merged

Conversation

compnerd
Copy link
Member

GetVolumeInformationW is documented as taking the root directory of
the volume to describe as lpRootPathName. We attempt to compute the
location by determining the volume mount point where the specified
path is mounted. However, GetVolumePathNameW does always return the
path to the volume mount point, which is the root of the volume where
the specified path. With a path substitution that is not rooted at a
volume root, the volume root with a relative path. As we need to get
to the root, force the stripping to the root via PathCchStripToRoot.

This should repair the
TestFoundation.TestFileManager/test_filesystemAttributes on Windows.

`GetVolumeInformationW` is documented as taking the root directory of
the volume to describe as `lpRootPathName`. We attempt to compute the
location by determining the volume mount point where the specified
path is mounted. However, `GetVolumePathNameW` does always return the
path to the volume mount point, which is the root of the volume where
the specified path.  With a path substitution that is not rooted at a
volume root, the volume root with a relative path. As we need to get
to the root, force the stripping to the root via `PathCchStripToRoot`.

This should repair the
TestFoundation.TestFileManager/test_filesystemAttributes on Windows.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 08f2025 into swiftlang:main Aug 15, 2021
@compnerd compnerd deleted the rooted branch August 15, 2021 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant