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

Side by Side Diff: remoting/host/win/launch_process_with_token.h

Issue 11231060: [Chromoting] The desktop process now creates a pre-connected pipe and passes (with some help of the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/win/host_service.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/win/scoped_handle.h" 15 #include "base/win/scoped_handle.h"
16 16
17 namespace base {
18 class SingleThreadTaskRunner;
19 } // namespace base
20
21 namespace IPC {
22 class ChannelProxy;
23 class Listener;
24 } // namespace IPC
25
17 namespace remoting { 26 namespace remoting {
18 27
19 // Pipe name prefix used by Chrome IPC channels to convert a channel name into 28 // Pipe name prefix used by Chrome IPC channels to convert a channel name into
20 // a pipe name. 29 // a pipe name.
21 extern const char kChromePipeNamePrefix[]; 30 extern const char kChromePipeNamePrefix[];
22 31
32 // Creates an already connected IPC channel. The server end of the channel
33 // is wrapped into a channel proxy that will invoke methods of |delegate|
34 // on the caller's thread while using |io_task_runner| to send and receive
35 // messages in the background. The client end is returned as an inheritable NT
36 // handle. |pipe_security_descriptor| is applied to the underlying pipe.
37 bool CreateConnectedIpcChannel(
38 const std::string& channel_name,
39 const std::string& pipe_security_descriptor,
40 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
41 IPC::Listener* delegate,
42 base::win::ScopedHandle* client_out,
43 scoped_ptr<IPC::ChannelProxy>* server_out);
44
23 // Creates the server end of the IPC channel and applies the security 45 // Creates the server end of the IPC channel and applies the security
24 // descriptor |pipe_security_descriptor| to it. 46 // descriptor |pipe_security_descriptor| to it.
25 bool CreateIpcChannel( 47 bool CreateIpcChannel(
26 const std::string& channel_name, 48 const std::string& channel_name,
27 const std::string& pipe_security_descriptor, 49 const std::string& pipe_security_descriptor,
28 base::win::ScopedHandle* pipe_out); 50 base::win::ScopedHandle* pipe_out);
29 51
30 // Creates a copy of the current process token for the given |session_id| so 52 // Creates a copy of the current process token for the given |session_id| so
31 // it can be used to launch a process in that session. 53 // it can be used to launch a process in that session.
32 bool CreateSessionToken(uint32 session_id, base::win::ScopedHandle* token_out); 54 bool CreateSessionToken(uint32 session_id, base::win::ScopedHandle* token_out);
33 55
34 // Generates a unique IPC channel name.
35 std::string GenerateIpcChannelName(void* client);
36
37 // Launches |binary| in the security context of the user represented by 56 // Launches |binary| in the security context of the user represented by
38 // |user_token|. The session ID specified by the token is respected as well. 57 // |user_token|. The session ID specified by the token is respected as well.
39 bool LaunchProcessWithToken(const FilePath& binary, 58 bool LaunchProcessWithToken(const FilePath& binary,
40 const CommandLine::StringType& command_line, 59 const CommandLine::StringType& command_line,
41 HANDLE user_token, 60 HANDLE user_token,
42 bool inherit_handles, 61 bool inherit_handles,
43 DWORD creation_flags, 62 DWORD creation_flags,
44 base::win::ScopedHandle* process_out, 63 base::win::ScopedHandle* process_out,
45 base::win::ScopedHandle* thread_out); 64 base::win::ScopedHandle* thread_out);
46 65
47 } // namespace remoting 66 } // namespace remoting
48 67
49 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_ 68 #endif // REMOTING_HOST_WIN_LAUNCH_PROCESS_WITH_TOKEN_H_
OLDNEW
« no previous file with comments | « remoting/host/win/host_service.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698