Chromium Code Reviews| Index: sandbox/win/src/broker_services.cc |
| =================================================================== |
| --- sandbox/win/src/broker_services.cc (revision 153000) |
| +++ sandbox/win/src/broker_services.cc (working copy) |
| @@ -9,6 +9,7 @@ |
| #include "base/threading/platform_thread.h" |
| #include "base/win/scoped_handle.h" |
| #include "base/win/scoped_process_information.h" |
| +#include "base/win/startup_information.h" |
| #include "sandbox/win/src/sandbox_policy_base.h" |
| #include "sandbox/win/src/sandbox.h" |
| #include "sandbox/win/src/target_process.h" |
| @@ -312,6 +313,14 @@ |
| if (ERROR_ALREADY_EXISTS == ::GetLastError()) |
| return SBOX_ERROR_GENERIC; |
| + // Initialize the startup information from the policy. |
| + base::win::StartupInformation startup_info; |
| + string16 desktop = policy_base->GetAlternateDesktop(); |
| + if (!desktop.empty()) { |
| + startup_info.startup_info()->lpDesktop = |
|
rvargas (doing something else)
2012/08/27 17:56:22
This is not really related with this CL, but I thi
jschuh
2012/08/27 19:10:19
You're right; I was lazy the first time around. I'
|
| + const_cast<wchar_t*>(desktop.c_str()); |
| + } |
| + |
| // Construct the thread pool here in case it is expensive. |
| // The thread pool is shared by all the targets |
| if (NULL == thread_pool_) |
| @@ -325,11 +334,8 @@ |
| job, |
| thread_pool_); |
| - std::wstring desktop = policy_base->GetAlternateDesktop(); |
| - |
| win_result = target->Create(exe_path, command_line, |
| - desktop.empty() ? NULL : desktop.c_str(), |
| - &process_info); |
| + &startup_info, &process_info); |
| if (ERROR_SUCCESS != win_result) |
| return SpawnCleanup(target, win_result); |