From 82b6f8a305e818524cc7e5f27a46de2d79e2872d Mon Sep 17 00:00:00 2001 From: Jarrod Meyer Date: Wed, 17 Jul 2024 16:18:40 -0400 Subject: [PATCH] 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 --- lib/std/os/windows.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index ab3e817155a1..fbad21e90bf7 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -452,7 +452,7 @@ pub fn WaitForSingleObjectEx(handle: HANDLE, milliseconds: DWORD, alertable: boo } pub fn WaitForMultipleObjectsEx(handles: []const HANDLE, waitAll: bool, milliseconds: DWORD, alertable: bool) !u32 { - assert(handles.len < MAXIMUM_WAIT_OBJECTS); + assert(handles.len > 0 and handles.len <= MAXIMUM_WAIT_OBJECTS); const nCount: DWORD = @as(DWORD, @intCast(handles.len)); switch (kernel32.WaitForMultipleObjectsEx( nCount,