Skip to content
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

Fix UNC paths #110033

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fix UNC paths #110033

wants to merge 4 commits into from

Conversation

agocke
Copy link
Member

@agocke agocke commented Nov 21, 2024

If the input file was a network path then the raw path returned by GetFinalPathByHandle may return a UNC path. If so, and if the original path wasn't a UNC path, we want to remove the UNC prefix unless it was necessary to fully resolve the path.

Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

If the input file was a network path then the raw path returned by
GetFinalPathByHandle may return a UNC path. If so, and if the original
path wasn't a UNC path, and the original path doesn't need normalization,
we want to use the original path.
Co-authored-by: Elinor Fung <elfung@microsoft.com>
@agocke
Copy link
Member Author

agocke commented Dec 10, 2024

Finished testing this around MAX_PATH. It has the expected behavior, as far as I can see. In particular, if you have a path that is very close to MAX_PATH, and the resultant UNC extended path exceeds MAX_PATH, the result will be a UNC path. I think that's fine, and it makes the code simpler to not deal with chopping off the extra UNC extended bytes.

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants