diff -r 93b982ccede2 -r 5daf16870df6 src/corelib/io/qwindowspipewriter.cpp --- a/src/corelib/io/qwindowspipewriter.cpp Mon Jun 21 22:38:13 2010 +0100 +++ b/src/corelib/io/qwindowspipewriter.cpp Thu Jul 22 16:41:55 2010 +0100 @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qwindowspipewriter_p.h" +#include QT_BEGIN_NAMESPACE @@ -100,7 +101,8 @@ void QWindowsPipeWriter::run() { - OVERLAPPED overl = {0, 0, 0, 0, NULL}; + OVERLAPPED overl; + memset(&overl, 0, sizeof overl); overl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); forever { lock.lock(); @@ -126,11 +128,9 @@ overl.OffsetHigh = 0; while ((!quitNow) && totalWritten < maxlen) { DWORD written = 0; - // Write 2k at a time to prevent flooding the pipe. If you - // write too much (4k-8k), the pipe can close - // unexpectedly. if (!WriteFile(writePipe, ptrData + totalWritten, - qMin(2048, maxlen - totalWritten), &written, &overl)) { + maxlen - totalWritten, &written, &overl)) { + if (GetLastError() == 0xE8/*NT_STATUS_INVALID_USER_BUFFER*/) { // give the os a rest msleep(100);