CreateIoCompletionPort function kernel32
Creates an input/output (I/O) completion port and associates it with a specified file handle, or creates an I/O completion port that is not yet associated with a file handle, allowing association at a later time.
To learn more, see learn.microsoft.com/windows/win32/api/ioapiset/nf-ioapiset-createiocompletionport.
Implementation
Win32Result<HANDLE> CreateIoCompletionPort(
HANDLE fileHandle,
HANDLE? existingCompletionPort,
int completionKey,
int numberOfConcurrentThreads,
) {
final result_ = CreateIoCompletionPort_Wrapper(
fileHandle,
existingCompletionPort ?? nullptr,
completionKey,
numberOfConcurrentThreads,
);
return Win32Result(value: HANDLE(result_.value.ptr), error: result_.error);
}