Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2164)

Unified Diff: base/process_util_win.cc

Issue 11419267: Add stdin_handle and stdout_handle in base::LaunchOptions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index a1a55ea6e4b73abd8a571f263aa66c24c9cf01fd..508583d9ed4ed3457123ff643a1f2506724f9f2d 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -293,6 +293,16 @@ 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) {
+ startup_info.dwFlags |= STARTF_USESTDHANDLES;
+ startup_info.hStdInput = options.stdin_handle ?
+ options.stdin_handle : GetStdHandle(STD_INPUT_HANDLE);
rvargas (doing something else) 2012/12/01 01:40:45 What happens when the current process has a non-de
Sergey Ulanov 2012/12/05 00:23:15 Isn't this the default behavior, i.e. aren't stdin
rvargas (doing something else) 2012/12/05 21:51:36 Sorry, I don't really follow this. What do you mea
Sergey Ulanov 2012/12/05 22:38:53 I didn't know about it. Is it documented anywhere
rvargas (doing something else) 2012/12/06 00:52:16 If the default behavior were to inherit handles th
Sergey Ulanov 2012/12/07 23:11:56 What I was asking about is if there is a way to re
rvargas (doing something else) 2012/12/07 23:46:52 I suspect passing INVALID_HANDLE_VALUE has that ef
+ startup_info.hStdOutput = options.stdout_handle ?
+ options.stdout_handle : GetStdHandle(STD_OUTPUT_HANDLE);
+ startup_info.hStdError = options.stderr_handle ?
+ options.stderr_handle : GetStdHandle(STD_ERROR_HANDLE);
+ }
+
DWORD flags = 0;
if (options.job_handle) {
« no previous file with comments | « base/process_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698