diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-05-17 16:17:29 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-05-17 14:47:20 +0000 |
commit | fade29581430e15d4f5b93b16500a6551d9c53f9 (patch) | |
tree | 636e6a33a9aa0eea1c9402eb713243b7ffe914e8 /src/corelib/io/qwindowspipereader.cpp | |
parent | af6b700bb8b8e73406e07d0544300706dd1e6f41 (diff) |
Remove qt_cancelIo helper function
We can now directly use CancelIoEx. The fallback to CancelIo
was needed for supporting Windows XP.
Change-Id: I24a53a774caf695e6006f24a914abaa5ab204035
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/corelib/io/qwindowspipereader.cpp')
-rw-r--r-- | src/corelib/io/qwindowspipereader.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index 15fb276be9..b8df8e8084 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -71,21 +71,6 @@ QWindowsPipeReader::QWindowsPipeReader(QObject *parent) this, &QWindowsPipeReader::emitPendingReadyRead, Qt::QueuedConnection); } -bool qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped) -{ - typedef BOOL (WINAPI *PtrCancelIoEx)(HANDLE, LPOVERLAPPED); - static PtrCancelIoEx ptrCancelIoEx = 0; - if (!ptrCancelIoEx) { - HMODULE kernel32 = GetModuleHandleA("kernel32"); - if (kernel32) - ptrCancelIoEx = PtrCancelIoEx(GetProcAddress(kernel32, "CancelIoEx")); - } - if (ptrCancelIoEx) - return ptrCancelIoEx(handle, overlapped); - else - return CancelIo(handle); -} - QWindowsPipeReader::~QWindowsPipeReader() { stop(); @@ -110,7 +95,7 @@ void QWindowsPipeReader::stop() { stopped = true; if (readSequenceStarted) { - if (!qt_cancelIo(handle, &overlapped)) { + if (!CancelIoEx(handle, &overlapped)) { const DWORD dwError = GetLastError(); if (dwError != ERROR_NOT_FOUND) { qErrnoWarning(dwError, "QWindowsPipeReader: qt_cancelIo on handle %x failed.", |