diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-09-03 22:06:26 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-05 21:17:44 +0200 |
commit | 50a8a5e7959ca315e812413661a76576b7c3bbb8 (patch) | |
tree | fadd591bb515323705ee372ea069b58471eedb07 /src/corelib/io/qprocess_win.cpp | |
parent | fba0a307914772b286e8f315e0d1dec5ce7935f8 (diff) |
add QProcess::InputChannelMode
this enables forwarding standard input from the parent process.
Change-Id: I7ee72b9842acc96320d4da693b95dd15d9a7b4d4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'src/corelib/io/qprocess_win.cpp')
-rw-r--r-- | src/corelib/io/qprocess_win.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index f545386f56..291ea319ec 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -156,7 +156,15 @@ bool QProcessPrivate::createChannel(Channel &channel) if (channel.type == Channel::Normal) { // we're piping this channel to our own process if (&channel == &stdinChannel) { - qt_create_pipe(channel.pipe, true); + if (inputChannelMode != QProcess::ForwardedInputChannel) { + qt_create_pipe(channel.pipe, true); + } else { + channel.pipe[1] = INVALID_Q_PIPE; + HANDLE hStdReadChannel = GetStdHandle(STD_INPUT_HANDLE); + HANDLE hCurrentProcess = GetCurrentProcess(); + DuplicateHandle(hCurrentProcess, hStdReadChannel, hCurrentProcess, + &channel.pipe[0], 0, TRUE, DUPLICATE_SAME_ACCESS); + } } else { QWindowsPipeReader *pipeReader = 0; if (&channel == &stdoutChannel) { |