| ... | @@ -270,12 +270,14 @@ pub const ChildProcess = struct { | ... | @@ -270,12 +270,14 @@ pub const ChildProcess = struct { |
| 270 | try buf.ensureTotalCapacity(new_capacity); | 270 | try buf.ensureTotalCapacity(new_capacity); |
| 271 | const next_buf = buf.unusedCapacitySlice(); | 271 | const next_buf = buf.unusedCapacitySlice(); |
| 272 | if (next_buf.len == 0) return .full; | 272 | if (next_buf.len == 0) return .full; |
| 273 | const read_result = windows.kernel32.ReadFile(handle, next_buf.ptr, math.cast(u32, next_buf.len) catch maxInt(u32), null, overlapped); | 273 | var read_bytes: u32 = undefined; |
| | 274 | const read_result = windows.kernel32.ReadFile(handle, next_buf.ptr, math.cast(u32, next_buf.len) catch maxInt(u32), &read_bytes, overlapped); |
| 274 | if (read_result == 0) return switch (windows.kernel32.GetLastError()) { | 275 | if (read_result == 0) return switch (windows.kernel32.GetLastError()) { |
| 275 | .IO_PENDING => .pending, | 276 | .IO_PENDING => .pending, |
| 276 | .BROKEN_PIPE => .closed, | 277 | .BROKEN_PIPE => .closed, |
| 277 | else => |err| windows.unexpectedError(err), | 278 | else => |err| windows.unexpectedError(err), |
| 278 | }; | 279 | }; |
| | 280 | buf.items.len += read_bytes; |
| 279 | } | 281 | } |
| 280 | } | 282 | } |
| 281 | | 283 | |