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 <string> | 9 #include <string> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
| 16 // Creates a copy of the current process token for the given |session_id| so |
| 17 // it can be used to launch a process in that session. |
| 18 bool CreateSessionToken(uint32 session_id, HANDLE* token_out); |
| 19 |
16 // Launches |binary| in the security context of the user represented by | 20 // Launches |binary| in the security context of the user represented by |
17 // |user_token|. The session ID specified by the token is respected as well. | 21 // |user_token|. The session ID specified by the token is respected as well. |
18 bool LaunchProcessWithToken(const FilePath& binary, | 22 bool LaunchProcessWithToken(const FilePath& binary, |
19 const std::wstring& command_line, | 23 const std::wstring& command_line, |
20 HANDLE user_token, | 24 HANDLE user_token, |
21 base::Process* process_out); | 25 base::Process* process_out); |
22 | 26 |
23 } // namespace remoting | 27 } // namespace remoting |
24 | 28 |
25 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ | 29 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ |
OLD | NEW |