| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 BOOL launched = | 294 BOOL launched = |
| 295 CreateProcessAsUser(options.as_user, NULL, | 295 CreateProcessAsUser(options.as_user, NULL, |
| 296 &writable_cmdline[0], | 296 &writable_cmdline[0], |
| 297 NULL, NULL, inherit_handles, flags, | 297 NULL, NULL, inherit_handles, flags, |
| 298 enviroment_block, NULL, startup_info, | 298 enviroment_block, NULL, startup_info, |
| 299 &temp_process_info); | 299 &temp_process_info); |
| 300 DestroyEnvironmentBlock(enviroment_block); | 300 DestroyEnvironmentBlock(enviroment_block); |
| 301 if (!launched) { | 301 if (!launched) { |
| 302 DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline) | 302 DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline) |
| 303 << std::endl;; | 303 << std::endl; |
| 304 return Process(); | 304 return Process(); |
| 305 } | 305 } |
| 306 } else { | 306 } else { |
| 307 if (!CreateProcess(NULL, | 307 if (!CreateProcess(NULL, |
| 308 &writable_cmdline[0], NULL, NULL, | 308 &writable_cmdline[0], NULL, NULL, |
| 309 inherit_handles, flags, NULL, NULL, | 309 inherit_handles, flags, NULL, NULL, |
| 310 startup_info, &temp_process_info)) { | 310 startup_info, &temp_process_info)) { |
| 311 DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline) | 311 DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline) |
| 312 << std::endl;; | 312 << std::endl; |
| 313 return Process(); | 313 return Process(); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 base::win::ScopedProcessInformation process_info(temp_process_info); | 316 base::win::ScopedProcessInformation process_info(temp_process_info); |
| 317 | 317 |
| 318 if (options.job_handle) { | 318 if (options.job_handle) { |
| 319 if (0 == AssignProcessToJobObject(options.job_handle, | 319 if (0 == AssignProcessToJobObject(options.job_handle, |
| 320 process_info.process_handle())) { | 320 process_info.process_handle())) { |
| 321 DLOG(ERROR) << "Could not AssignProcessToObject."; | 321 DLOG(ERROR) << "Could not AssignProcessToObject."; |
| 322 Process scoped_process(process_info.TakeProcessHandle()); | 322 Process scoped_process(process_info.TakeProcessHandle()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 380 |
| 381 bool GetAppOutput(const StringPiece16& cl, std::string* output) { | 381 bool GetAppOutput(const StringPiece16& cl, std::string* output) { |
| 382 return GetAppOutputInternal(cl, false, output); | 382 return GetAppOutputInternal(cl, false, output); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void RaiseProcessToHighPriority() { | 385 void RaiseProcessToHighPriority() { |
| 386 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); | 386 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace base | 389 } // namespace base |
| OLD | NEW |