Skip to content

Commit fbf9750

Browse files
committed
winrio: test that IOCP-based RIO is supported
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 10533c3 commit fbf9750

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

conn/winrio/rio_windows.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,17 @@ func Initialize() bool {
118118
if err != nil {
119119
return
120120
}
121+
121122
// While we should be able to stop here, after getting the function pointers, some anti-virus actually causes
122123
// failures in RIOCreateRequestQueue, so keep going to be certain this is supported.
123-
cq, err = CreatePolledCompletionQueue(2)
124+
var iocp windows.Handle
125+
iocp, err = windows.CreateIoCompletionPort(windows.InvalidHandle, 0, 0, 0)
126+
if err != nil {
127+
return
128+
}
129+
defer windows.CloseHandle(iocp)
130+
var overlapped windows.Overlapped
131+
cq, err = CreateIOCPCompletionQueue(2, iocp, 0, &overlapped)
124132
if err != nil {
125133
return
126134
}

0 commit comments

Comments
 (0)