summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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