summaryrefslogtreecommitdiffstats
path: root/base/process_util_win.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-05 02:30:14 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-05 02:30:14 +0000
commitd7f5ee8bafe8fcef53d1ea407e4b48524ce5fef2 (patch)
tree612e4d5990277028dfb51b651eca159cf39eabad /base/process_util_win.cc
parentccecfd3120f403b2f17bac2452d00ede3013fbf2 (diff)
downloadchromium_src-d7f5ee8bafe8fcef53d1ea407e4b48524ce5fef2.zip
chromium_src-d7f5ee8bafe8fcef53d1ea407e4b48524ce5fef2.tar.gz
chromium_src-d7f5ee8bafe8fcef53d1ea407e4b48524ce5fef2.tar.bz2
Add stdin_handle and stdout_handle in base::LaunchOptions.
New members in LaunchOptions will allow to redirect stdin and stdout on Windows. This change was originally implemented by eaugusti@chromium.com in crrev.com/10918255 . BUG=142915 Review URL: https://chromiumcodereview.appspot.com/11419267 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r--base/process_util_win.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index a1a55ea..3addf51 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -293,6 +293,17 @@ bool LaunchProcess(const string16& cmdline,
startup_info.dwFlags = STARTF_USESHOWWINDOW;
startup_info.wShowWindow = options.start_hidden ? SW_HIDE : SW_SHOW;
+ if (options.stdin_handle || options.stdout_handle || options.stderr_handle) {
+ DCHECK(options.inherit_handles);
+ DCHECK(options.stdin_handle);
+ DCHECK(options.stdout_handle);
+ DCHECK(options.stderr_handle);
+ startup_info.dwFlags |= STARTF_USESTDHANDLES;
+ startup_info.hStdInput = options.stdin_handle;
+ startup_info.hStdOutput = options.stdout_handle;
+ startup_info.hStdError = options.stderr_handle;
+ }
+
DWORD flags = 0;
if (options.job_handle) {