std.os.windows.ReadLink: add missing alignment of local data buffer

This commit is contained in:
Andrew Kelley 2022-11-30 12:55:23 -07:00
parent 71038c42f5
commit 44ee1c885f

View File

@ -802,7 +802,7 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin
} }
defer CloseHandle(result_handle); defer CloseHandle(result_handle);
var reparse_buf: [MAXIMUM_REPARSE_DATA_BUFFER_SIZE]u8 = undefined; var reparse_buf: [MAXIMUM_REPARSE_DATA_BUFFER_SIZE]u8 align(@alignOf(REPARSE_DATA_BUFFER)) = undefined;
_ = DeviceIoControl(result_handle, FSCTL_GET_REPARSE_POINT, null, reparse_buf[0..]) catch |err| switch (err) { _ = DeviceIoControl(result_handle, FSCTL_GET_REPARSE_POINT, null, reparse_buf[0..]) catch |err| switch (err) {
error.AccessDenied => unreachable, error.AccessDenied => unreachable,
else => |e| return e, else => |e| return e,