| ... | @@ -52,7 +52,8 @@ pub const WriteError = error{ | ... | @@ -52,7 +52,8 @@ pub const WriteError = error{ |
| 52 | }; | 52 | }; |
| 53 | | 53 | |
| 54 | pub fn windowsWrite(handle: windows.HANDLE, bytes: []const u8) WriteError!void { | 54 | pub fn windowsWrite(handle: windows.HANDLE, bytes: []const u8) WriteError!void { |
| 55 | if (windows.WriteFile(handle, bytes.ptr, @intCast(u32, bytes.len), null, null) == 0) { | 55 | var bytes_written: windows.DWORD = undefined; |
| | 56 | if (windows.WriteFile(handle, bytes.ptr, @intCast(u32, bytes.len), &bytes_written, null) == 0) { |
| 56 | const err = windows.GetLastError(); | 57 | const err = windows.GetLastError(); |
| 57 | return switch (err) { | 58 | return switch (err) { |
| 58 | windows.ERROR.INVALID_USER_BUFFER => WriteError.SystemResources, | 59 | windows.ERROR.INVALID_USER_BUFFER => WriteError.SystemResources, |