std: fix windows.GetOverlappedResult

This commit is contained in:
daurnimator 2019-11-19 16:40:24 +11:00
parent ce9966a39b
commit 6b5b0e6cd6
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A

View File

@ -141,9 +141,9 @@ pub fn DeviceIoControl(
pub fn GetOverlappedResult(h: HANDLE, overlapped: *OVERLAPPED, wait: bool) !DWORD {
var bytes: DWORD = undefined;
if (kernel32.GetOverlappedResult(h, overlapped, &bytes, wait) == 0) {
if (kernel32.GetOverlappedResult(h, overlapped, &bytes, @boolToInt(wait)) == 0) {
switch (kernel32.GetLastError()) {
ERROR_IO_INCOMPLETE => if (!wait) return error.WouldBlock else unreachable,
ERROR.IO_INCOMPLETE => if (!wait) return error.WouldBlock else unreachable,
else => |err| return unexpectedError(err),
}
}