Function GetQueuedCompletionStatusEx [src]

Prototype

pub fn GetQueuedCompletionStatusEx( completion_port: HANDLE, completion_port_entries: []OVERLAPPED_ENTRY, timeout_ms: ?DWORD, alertable: bool, ) GetQueuedCompletionStatusError!u32

Parameters

completion_port: HANDLEcompletion_port_entries: []OVERLAPPED_ENTRYtimeout_ms: ?DWORDalertable: bool

Possible Errors

Aborted
Cancelled
EOF
Timeout
Unexpected UnexpectedError

The Operating System returned an undocumented error code.

This error is in theory not possible, but it would be better to handle this error than to invoke undefined behavior.

When this error code is observed, it usually means the Zig Standard Library needs a small patch to add the error code to the error set for the respective function.

Source

pub fn GetQueuedCompletionStatusEx( completion_port: HANDLE, completion_port_entries: []OVERLAPPED_ENTRY, timeout_ms: ?DWORD, alertable: bool, ) GetQueuedCompletionStatusError!u32 { var num_entries_removed: u32 = 0; const success = kernel32.GetQueuedCompletionStatusEx( completion_port, completion_port_entries.ptr, @as(ULONG, @intCast(completion_port_entries.len)), &num_entries_removed, timeout_ms orelse INFINITE, @intFromBool(alertable), ); if (success == FALSE) { return switch (GetLastError()) { .ABANDONED_WAIT_0 => error.Aborted, .OPERATION_ABORTED => error.Cancelled, .HANDLE_EOF => error.EOF, .WAIT_TIMEOUT => error.Timeout, else => |err| unexpectedError(err), }; } return num_entries_removed; }