Skip to content

Commit d375a20

Browse files
committed
windows.zig: make WaitForMultipleObjectsEx assert MAXIMUM_WAIT_OBJECTS, inclusive.
Additionally, the parameter must not be zero. source: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects
1 parent c3faae6 commit d375a20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std/os/windows.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ 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 <= MAXIMUM_WAIT_OBJECTS);
456+
assert(handles.len != 0);
456457
const nCount: DWORD = @as(DWORD, @intCast(handles.len));
457458
switch (kernel32.WaitForMultipleObjectsEx(
458459
nCount,

0 commit comments

Comments
 (0)