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

windows: support UNC paths #15283

Closed
wants to merge 1 commit into from

Conversation

nolanderc
Copy link
Contributor

Fixes #8205 and #12729.

The old method of prepending \??\ at the start of the DOS path produced invalid strings for UNC paths (such as those found in WSL). Instead, we rely on the conversion routine in ntdll, which should handle all current and future edge cases properly.

Fixes ziglang#8205 and ziglang#12729.

The old method of prepending `\??\` at the start of the DOS path
produced invalid strings for UNC paths (such as those found in WSL).
Instead, we rely on the conversion routine in ntdll, which should handle
all current and future edge cases properly.
@Vexu Vexu force-pushed the windows-unc-paths branch from d6c5391 to a142049 Compare April 23, 2023 17:23
@Vexu Vexu enabled auto-merge (rebase) April 23, 2023 18:07
@squeek502
Copy link
Collaborator

squeek502 commented May 18, 2023

Unfortunately RtlDosPathNameToNtPathName_U is not usable here due to its heap allocation. Here's a previous pull request that was rejected for this reason: #7537

In particular: #7537 (comment)

This introduces unnecessary heap allocation, causing OutOfMemory to be added to the OpenError set. We can do better. Check the wine implementation of RtlDosPathNameToNtPathName_U_WithStatus for inspiration. Opening a file should not do heap allocation for the path name.

For more context, see #7664 which is where the current logic (specifically to avoid depending on RtlDosPathNameToNtPathName_U) came from

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.

Unreachable code reached when using UNC paths on Windows
3 participants