fn parseReadLinkPath(path: []const u16, is_relative: bool, out_buffer: []u16) error path: []const u16is_relative: boolout_buffer: []u168339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351fn parseReadLinkPath(path: []const u16, is_relative: bool, out_buffer: []u16) error{NameTooLong}![]u16 {
path: {
if (is_relative) break :path;
return windows.ntToWin32Namespace(path, out_buffer) catch |err| switch (err) {
error.NameTooLong => |e| return e,
error.NotNtPath => break :path,
};
}
if (out_buffer.len < path.len) return error.NameTooLong;
const dest = out_buffer[0..path.len];
@memcpy(dest, path);
return dest;
}