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

Unified Diff: base/process_util.h

Issue 555192: Add a utility function to run a process as an arbitrary user... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 11 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
Index: base/process_util.h
===================================================================
--- base/process_util.h (revision 37643)
+++ base/process_util.h (working copy)
@@ -140,6 +140,20 @@
// that it doesn't leak!
bool LaunchApp(const std::wstring& cmdline,
bool wait, bool start_hidden, ProcessHandle* process_handle);
+
+// Runs the given application name with the given command line as if the user
+// represented by |token| had launched it. The caveats about |cmdline| and
+// |process_handle| explained for LaunchApp above apply as well.
+//
+// Whether the application is visible on the interactive desktop depends on
+// the token belonging to an interactive logon session.
+//
+// To avoid hard to diagnose problems, this function internally loads the
+// environment variables associated with the user and if this operation fails
+// the entire call fails as well.
+bool LaunchAppAsUser(UserTokenHandle token, const std::wstring& cmdline,
+ bool start_hidden, ProcessHandle* process_handle);
+
#elif defined(OS_POSIX)
// Runs the application specified in argv[0] with the command line argv.
// Before launching all FDs open in the parent process will be marked as
« no previous file with comments | « base/process.h ('k') | base/process_util_unittest.cc » ('j') | base/process_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698