From fbf97502cfcfcf35e7963e02b4412e46396334a1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 6 Apr 2021 11:45:10 -0600 Subject: [PATCH] winrio: test that IOCP-based RIO is supported Signed-off-by: Jason A. Donenfeld --- conn/winrio/rio_windows.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conn/winrio/rio_windows.go b/conn/winrio/rio_windows.go index 2f13ec8..0a07c65 100644 --- a/conn/winrio/rio_windows.go +++ b/conn/winrio/rio_windows.go @@ -118,9 +118,17 @@ func Initialize() bool { if err != nil { return } + // While we should be able to stop here, after getting the function pointers, some anti-virus actually causes // failures in RIOCreateRequestQueue, so keep going to be certain this is supported. - cq, err = CreatePolledCompletionQueue(2) + var iocp windows.Handle + iocp, err = windows.CreateIoCompletionPort(windows.InvalidHandle, 0, 0, 0) + if err != nil { + return + } + defer windows.CloseHandle(iocp) + var overlapped windows.Overlapped + cq, err = CreateIOCPCompletionQueue(2, iocp, 0, &overlapped) if err != nil { return }