Skip to content

Commit 82b6f8a

Browse files
committed
windows.zig: make the WaitForMultipleObjectsEx assertion inclusive.
Additionally, the parameter must not be zero. source: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects
1 parent 7aaebd1 commit 82b6f8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/os/windows.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ pub fn WaitForSingleObjectEx(handle: HANDLE, milliseconds: DWORD, alertable: boo
452452
}
453453

454454
pub fn WaitForMultipleObjectsEx(handles: []const HANDLE, waitAll: bool, milliseconds: DWORD, alertable: bool) !u32 {
455-
assert(handles.len < MAXIMUM_WAIT_OBJECTS);
455+
assert(handles.len > 0 and handles.len <= MAXIMUM_WAIT_OBJECTS);
456456
const nCount: DWORD = @as(DWORD, @intCast(handles.len));
457457
switch (kernel32.WaitForMultipleObjectsEx(
458458
nCount,

0 commit comments

Comments
 (0)