| ... | @@ -8176,31 +8176,16 @@ fn dirReadLinkWindows(dir: Dir, sub_path: []const u8, buffer: []u8) Dir.ReadLink | ... | @@ -8176,31 +8176,16 @@ fn dirReadLinkWindows(dir: Dir, sub_path: []const u8, buffer: []u8) Dir.ReadLink |
| 8176 | defer windows.CloseHandle(result_handle); | 8176 | defer windows.CloseHandle(result_handle); |
| 8177 | | 8177 | |
| 8178 | var reparse_buf: [windows.MAXIMUM_REPARSE_DATA_BUFFER_SIZE]u8 align(@alignOf(windows.REPARSE_DATA_BUFFER)) = undefined; | 8178 | var reparse_buf: [windows.MAXIMUM_REPARSE_DATA_BUFFER_SIZE]u8 align(@alignOf(windows.REPARSE_DATA_BUFFER)) = undefined; |
| 8179 | | 8179 | switch ((try deviceIoControl(&.{ |
| 8180 | syscall = try .start(); | 8180 | .file = .{ .handle = result_handle, .flags = .{ .nonblocking = true } }, |
| 8181 | while (true) switch (windows.ntdll.NtFsControlFile( | 8181 | .code = .GET_REPARSE_POINT, |
| 8182 | result_handle, | 8182 | .out = &reparse_buf, |
| 8183 | null, // event | 8183 | })).u.Status) { |
| 8184 | null, // APC routine | 8184 | .SUCCESS => {}, |
| 8185 | null, // APC context | 8185 | .CANCELLED => unreachable, |
| 8186 | &io_status_block, | 8186 | .NOT_A_REPARSE_POINT => return error.NotLink, |
| 8187 | .GET_REPARSE_POINT, | 8187 | else => |status| return windows.unexpectedStatus(status), |
| 8188 | null, // input buffer | 8188 | } |
| 8189 | 0, // input buffer length | | |
| 8190 | &reparse_buf, | | |
| 8191 | reparse_buf.len, | | |
| 8192 | )) { | | |
| 8193 | .SUCCESS => { | | |
| 8194 | syscall.finish(); | | |
| 8195 | break; | | |
| 8196 | }, | | |
| 8197 | .CANCELLED => { | | |
| 8198 | try syscall.checkCancel(); | | |
| 8199 | continue; | | |
| 8200 | }, | | |
| 8201 | .NOT_A_REPARSE_POINT => return syscall.fail(error.NotLink), | | |
| 8202 | else => |status| return syscall.unexpectedNtstatus(status), | | |
| 8203 | }; | | |
| 8204 | | 8189 | |
| 8205 | const reparse_struct: *const windows.REPARSE_DATA_BUFFER = @ptrCast(@alignCast(&reparse_buf)); | 8190 | const reparse_struct: *const windows.REPARSE_DATA_BUFFER = @ptrCast(@alignCast(&reparse_buf)); |
| 8206 | const IoReparseTagInt = @typeInfo(windows.IO_REPARSE_TAG).@"struct".backing_integer.?; | 8191 | const IoReparseTagInt = @typeInfo(windows.IO_REPARSE_TAG).@"struct".backing_integer.?; |