| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/process/launch.h" | 5 #include "base/process/launch.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 DPLOG(ERROR); | 142 DPLOG(ERROR); |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 | 145 |
| 146 inherit_handles = true; | 146 inherit_handles = true; |
| 147 flags |= EXTENDED_STARTUPINFO_PRESENT; | 147 flags |= EXTENDED_STARTUPINFO_PRESENT; |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 if (options.empty_desktop_name) | 151 if (options.empty_desktop_name) |
| 152 startup_info->lpDesktop = L""; | 152 startup_info->lpDesktop = const_cast<wchar_t*>(L""); |
| 153 startup_info->dwFlags = STARTF_USESHOWWINDOW; | 153 startup_info->dwFlags = STARTF_USESHOWWINDOW; |
| 154 startup_info->wShowWindow = options.start_hidden ? SW_HIDE : SW_SHOW; | 154 startup_info->wShowWindow = options.start_hidden ? SW_HIDE : SW_SHOW; |
| 155 | 155 |
| 156 if (options.stdin_handle || options.stdout_handle || options.stderr_handle) { | 156 if (options.stdin_handle || options.stdout_handle || options.stderr_handle) { |
| 157 DCHECK(inherit_handles); | 157 DCHECK(inherit_handles); |
| 158 DCHECK(options.stdin_handle); | 158 DCHECK(options.stdin_handle); |
| 159 DCHECK(options.stdout_handle); | 159 DCHECK(options.stdout_handle); |
| 160 DCHECK(options.stderr_handle); | 160 DCHECK(options.stderr_handle); |
| 161 startup_info->dwFlags |= STARTF_USESTDHANDLES; | 161 startup_info->dwFlags |= STARTF_USESTDHANDLES; |
| 162 startup_info->hStdInput = options.stdin_handle; | 162 startup_info->hStdInput = options.stdin_handle; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 WaitForSingleObject(proc_info.process_handle(), INFINITE); | 373 WaitForSingleObject(proc_info.process_handle(), INFINITE); |
| 374 | 374 |
| 375 return true; | 375 return true; |
| 376 } | 376 } |
| 377 | 377 |
| 378 void RaiseProcessToHighPriority() { | 378 void RaiseProcessToHighPriority() { |
| 379 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 379 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace base | 382 } // namespace base |
| OLD | NEW |