| Index: base/process/launch_win.cc
|
| diff --git a/base/process/launch_win.cc b/base/process/launch_win.cc
|
| index a3303a5e08588669aac9d84cf6f9acdb2473b594..3c787fe4ea2880e90db0e080076958787488d302 100644
|
| --- a/base/process/launch_win.cc
|
| +++ b/base/process/launch_win.cc
|
| @@ -244,9 +244,17 @@ bool LaunchProcess(const CommandLine& cmdline,
|
| return rv;
|
| }
|
|
|
| -bool LaunchElevatedProcess(const CommandLine& cmdline,
|
| - const LaunchOptions& options,
|
| - ProcessHandle* process_handle) {
|
| +Process LaunchProcess(const CommandLine& cmdline,
|
| + const LaunchOptions& options) {
|
| + ProcessHandle process_handle;
|
| + if (LaunchProcess(cmdline, options, &process_handle))
|
| + return Process(process_handle);
|
| +
|
| + return Process();
|
| +}
|
| +
|
| +Process LaunchElevatedProcess(const CommandLine& cmdline,
|
| + const LaunchOptions& options) {
|
| const string16 file = cmdline.GetProgram().value();
|
| const string16 arguments = cmdline.GetArgumentsString();
|
|
|
| @@ -263,20 +271,13 @@ bool LaunchElevatedProcess(const CommandLine& cmdline,
|
|
|
| if (!ShellExecuteEx(&shex_info)) {
|
| DPLOG(ERROR);
|
| - return false;
|
| + return Process();
|
| }
|
|
|
| if (options.wait)
|
| WaitForSingleObject(shex_info.hProcess, INFINITE);
|
|
|
| - // If the caller wants the process handle give it to them, otherwise just
|
| - // close it. Closing it does not terminate the process.
|
| - if (process_handle)
|
| - *process_handle = shex_info.hProcess;
|
| - else
|
| - CloseHandle(shex_info.hProcess);
|
| -
|
| - return true;
|
| + return Process(shex_info.hProcess);
|
| }
|
|
|
| bool SetJobObjectLimitFlags(HANDLE job_object, DWORD limit_flags) {
|
|
|