| ... | ... | @@ -270,12 +270,14 @@ pub const ChildProcess = struct { |
| 270 | 270 | try buf.ensureTotalCapacity(new_capacity); |
| 271 | 271 | const next_buf = buf.unusedCapacitySlice(); |
| 272 | 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 | 275 | if (read_result == 0) return switch (windows.kernel32.GetLastError()) { |
| 275 | 276 | .IO_PENDING => .pending, |
| 276 | 277 | .BROKEN_PIPE => .closed, |
| 277 | 278 | else => |err| windows.unexpectedError(err), |
| 278 | 279 | }; |
| 280 | buf.items.len += read_bytes; |
| 279 | 281 | } |
| 280 | 282 | } |
| 281 | 283 | |