http://bugs.winehq.org/show_bug.cgi?id=11188
--- Comment #85 from John M. Drescher drescherjm@gmail.com 2009-01-07 18:12:10 --- I find that IOCP was added in 0.9.39.
HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle, HANDLE hExistingCompletionPort, ULONG_PTR CompletionKey, DWORD dwNumberOfConcurrentThreads) { NTSTATUS status; HANDLE ret = 0;
TRACE("(%p, %p, %08lx, %08x)\n", hFileHandle, hExistingCompletionPort, CompletionKey, dwNumberOfConcurrentThreads);
if (hExistingCompletionPort && hFileHandle == INVALID_HANDLE_VALUE) { SetLastError( ERROR_INVALID_PARAMETER); return NULL; }
if (hExistingCompletionPort) ret = hExistingCompletionPort; else { status = NtCreateIoCompletion( &ret, IO_COMPLETION_ALL_ACCESS, NULL, dwNumberOfConcurrentThreads ); if (status != STATUS_SUCCESS) goto fail; }
if (hFileHandle != INVALID_HANDLE_VALUE) { FILE_COMPLETION_INFORMATION info; IO_STATUS_BLOCK iosb;
info.CompletionPort = ret; info.CompletionKey = CompletionKey; status = NtSetInformationFile( hFileHandle, &iosb, &info, sizeof(info), FileCompletionInformation ); if (status != STATUS_SUCCESS) goto fail; }
return ret;
fail: if (ret && !hExistingCompletionPort) CloseHandle( ret ); SetLastError( RtlNtStatusToDosError(status) ); return 0; }