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) { |