Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1673)

Unified Diff: sandbox/win/src/broker_services.cc

Issue 10878071: Move STARTUPINFO manipulation into SpawnTarget (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/win/src/target_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/broker_services.cc
===================================================================
--- sandbox/win/src/broker_services.cc (revision 153543)
+++ 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 =
+ 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);
« no previous file with comments | « no previous file | sandbox/win/src/target_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698