| Index: base/process/launch_win.cc
|
| diff --git a/base/process/launch_win.cc b/base/process/launch_win.cc
|
| index 985dccc0a3214b3d5d704127ab10721b5dd301ad..38aa0125fe0796cf3d07c22657edae8f4e4c9e43 100644
|
| --- a/base/process/launch_win.cc
|
| +++ b/base/process/launch_win.cc
|
| @@ -290,6 +290,10 @@ Process LaunchProcess(const string16& cmdline,
|
|
|
| PROCESS_INFORMATION temp_process_info = {};
|
|
|
| + LPCTSTR current_directory = options.current_directory.empty()
|
| + ? NULL
|
| + : options.current_directory.value().c_str();
|
| +
|
| string16 writable_cmdline(cmdline);
|
| if (options.as_user) {
|
| flags |= CREATE_UNICODE_ENVIRONMENT;
|
| @@ -300,12 +304,10 @@ Process LaunchProcess(const string16& cmdline,
|
| return Process();
|
| }
|
|
|
| - BOOL launched =
|
| - CreateProcessAsUser(options.as_user, NULL,
|
| - &writable_cmdline[0],
|
| - NULL, NULL, inherit_handles, flags,
|
| - enviroment_block, NULL, startup_info,
|
| - &temp_process_info);
|
| + BOOL launched = CreateProcessAsUser(
|
| + options.as_user, NULL, &writable_cmdline[0], NULL, NULL,
|
| + inherit_handles, flags, enviroment_block, current_directory,
|
| + startup_info, &temp_process_info);
|
| DestroyEnvironmentBlock(enviroment_block);
|
| if (!launched) {
|
| DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline)
|
| @@ -313,10 +315,9 @@ Process LaunchProcess(const string16& cmdline,
|
| return Process();
|
| }
|
| } else {
|
| - if (!CreateProcess(NULL,
|
| - &writable_cmdline[0], NULL, NULL,
|
| - inherit_handles, flags, NULL, NULL,
|
| - startup_info, &temp_process_info)) {
|
| + if (!CreateProcess(NULL, &writable_cmdline[0], NULL, NULL, inherit_handles,
|
| + flags, NULL, current_directory, startup_info,
|
| + &temp_process_info)) {
|
| DPLOG(ERROR) << "Command line:" << std::endl << UTF16ToUTF8(cmdline)
|
| << std::endl;
|
| return Process();
|
|
|