From 9a4d30d9995a806ca7c69692992383b28c655054 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 31 Jan 2012 12:10:45 +0100 Subject: MinGW build fixes for QWindowsPipeReader and friends Change-Id: Ie4d6017c6fb918e7796d1a5e8863e9368e4e1894 Reviewed-by: Friedemann Kleint --- src/corelib/io/qprocess_win.cpp | 5 ++++- src/corelib/io/qwindowspipereader.cpp | 3 ++- src/corelib/io/qwindowspipereader_p.h | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/corelib/io') 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 -- cgit v1.2.3