OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ | 5 #ifndef REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ |
6 #define REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ | 6 #define REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // Creates a copy of the current process token for the given |session_id| so | 23 // Creates a copy of the current process token for the given |session_id| so |
24 // it can be used to launch a process in that session. | 24 // it can be used to launch a process in that session. |
25 bool CreateSessionToken(uint32_t session_id, | 25 bool CreateSessionToken(uint32_t session_id, |
26 base::win::ScopedHandle* token_out); | 26 base::win::ScopedHandle* token_out); |
27 | 27 |
28 // Launches |binary| in the security context of the user represented by | 28 // Launches |binary| in the security context of the user represented by |
29 // |user_token|. The session ID specified by the token is respected as well. | 29 // |user_token|. The session ID specified by the token is respected as well. |
30 // If |handles_to_inherit| is non-empty, these handles will be inherited by the | 30 // If |handles_to_inherit| is non-empty, these handles will be inherited by the |
31 // new process. The other parameters are passed directly to | 31 // new process. The other parameters are passed directly to |
32 // CreateProcessAsUser(). | 32 // CreateProcessAsUser(). |
33 bool LaunchProcessWithToken( | 33 bool LaunchProcessWithToken(const base::FilePath& binary, |
34 const base::FilePath& binary, | 34 const base::CommandLine::StringType& command_line, |
35 const base::CommandLine::StringType& command_line, | 35 HANDLE user_token, |
36 HANDLE user_token, | 36 SECURITY_ATTRIBUTES* process_attributes, |
37 SECURITY_ATTRIBUTES* process_attributes, | 37 SECURITY_ATTRIBUTES* thread_attributes, |
38 SECURITY_ATTRIBUTES* thread_attributes, | 38 const std::vector<HANDLE>& handles_to_inherit, |
39 const base::HandlesToInheritVector& handles_to_inherit, | 39 DWORD creation_flags, |
40 DWORD creation_flags, | 40 const base::char16* desktop_name, |
41 const base::char16* desktop_name, | 41 base::win::ScopedHandle* process_out, |
42 base::win::ScopedHandle* process_out, | 42 base::win::ScopedHandle* thread_out); |
43 base::win::ScopedHandle* thread_out); | |
44 | 43 |
45 } // namespace remoting | 44 } // namespace remoting |
46 | 45 |
47 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ | 46 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ |
OLD | NEW |