aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-08-06 18:51:17 +0200
committerJakub Konka <kubkon@jakubkonka.com>2020-08-07 11:33:05 +0200
commitbdda8fa7a818c90803fb64f9784040bf3b9f0a5e (patch)
treea4df7ab11a30dd02d1593d74b6576f53ebbb1517 /lib/std/os.zig
parente8abfef2aa8579121fbd13b8df84e8f68b533fa4 (diff)
downloadzig-bdda8fa7a818c90803fb64f9784040bf3b9f0a5e.tar.gz
zig-bdda8fa7a818c90803fb64f9784040bf3b9f0a5e.zip
Redo GetFinalPathNameByHandle using DeviceIoControl
This commit reimagines `std.os.windows.GetFinalPathNameByHandle` using `DeviceIoControl` to query the OS mount manager for the DOS (symlink) paths for the given NT volume name. In particular, it uses `IOCTL_MOUNTMGR_QUERY_POINTS` ioctl opcode to query the manager for the available moount points.
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 88ce77dc56..04c2340cad 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -4094,7 +4094,7 @@ pub fn realpathW(pathname: []const u16, out_buffer: *[MAX_PATH_BYTES]u8) RealPat
defer w.CloseHandle(h_file);
var wide_buf: [w.PATH_MAX_WIDE]u16 = undefined;
- const wide_slice = try w.GetFinalPathNameByHandle(h_file, wide_buf[0..]);
+ const wide_slice = try w.GetFinalPathNameByHandle(h_file, .{}, wide_buf[0..]);
// Trust that Windows gives us valid UTF-16LE.
const end_index = std.unicode.utf16leToUtf8(out_buffer, wide_slice) catch unreachable;