summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2012-01-31 12:10:45 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-31 16:17:55 +0100
commit9a4d30d9995a806ca7c69692992383b28c655054 (patch)
treeb172b7f08f52cdeae4e17ec897c5ca21abac70f2
parent20beb5ff538a4de73b7430583829089e39024d05 (diff)
MinGW build fixes for QWindowsPipeReader and friends
Change-Id: Ie4d6017c6fb918e7796d1a5e8863e9368e4e1894 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rw-r--r--src/corelib/io/qprocess_win.cpp5
-rw-r--r--src/corelib/io/qwindowspipereader.cpp3
-rw-r--r--src/corelib/io/qwindowspipereader_p.h1
3 files changed, 6 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 1a5e6a9e59..fd5c08b23e 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -56,6 +56,9 @@
#include "private/qfsfileengine_p.h" // for longFileName
+#ifndef PIPE_REJECT_REMOTE_CLIENTS
+#define PIPE_REJECT_REMOTE_CLIENTS 0x08
+#endif
#ifndef QT_NO_PROCESS
@@ -80,7 +83,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
forever {
// ### The user must make sure to call qsrand() to make the pipe names less predictable.
// ### Replace the call to qrand() with a secure version, once we have it in Qt.
- swprintf_s(pipeName, sizeof(pipeName) / sizeof(wchar_t), L"\\\\.\\pipe\\qt-%X", qrand());
+ swprintf(pipeName, L"\\\\.\\pipe\\qt-%X", qrand());
const DWORD dwPipeBufferSize = 1024 * 1024;
hRead = CreateNamedPipe(pipeName,
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index b446dce0f3..61ab5c9440 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -67,7 +67,7 @@ QWindowsPipeReader::QWindowsPipeReader(QObject *parent)
QWindowsPipeReader::~QWindowsPipeReader()
{
if (readSequenceStarted) {
- CancelIoEx(handle, &overlapped);
+ CancelIo(handle);
dataReadNotifier->waitForNotified(-1);
}
}
@@ -175,6 +175,7 @@ void QWindowsPipeReader::notified(DWORD numberOfBytesRead, DWORD errorCode)
*/
void QWindowsPipeReader::startAsyncRead()
{
+ const DWORD minReadBufferSize = 4096;
DWORD bytesToRead = qMax(checkPipeState(), minReadBufferSize);
if (pipeBroken)
return;
diff --git a/src/corelib/io/qwindowspipereader_p.h b/src/corelib/io/qwindowspipereader_p.h
index 4f0bb57535..d9d9cf9717 100644
--- a/src/corelib/io/qwindowspipereader_p.h
+++ b/src/corelib/io/qwindowspipereader_p.h
@@ -113,7 +113,6 @@ private:
QTimer *emitReadyReadTimer;
bool pipeBroken;
bool readyReadEmitted;
- static const DWORD minReadBufferSize = 4096;
};
QT_END_NAMESPACE