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 SANDBOX_SRC_TARGET_PROCESS_H__ | 5 #ifndef SANDBOX_SRC_TARGET_PROCESS_H__ |
6 #define SANDBOX_SRC_TARGET_PROCESS_H__ | 6 #define SANDBOX_SRC_TARGET_PROCESS_H__ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/win/scoped_handle.h" | 12 #include "base/win/scoped_handle.h" |
13 #include "base/win/scoped_process_information.h" | 13 #include "base/win/scoped_process_information.h" |
14 #include "base/win/startup_information.h" | |
rvargas (doing something else)
2012/08/27 17:56:22
nit: forward declare
jschuh
2012/08/27 19:10:19
Done.
| |
14 #include "sandbox/win/src/crosscall_server.h" | 15 #include "sandbox/win/src/crosscall_server.h" |
15 #include "sandbox/win/src/sandbox_types.h" | 16 #include "sandbox/win/src/sandbox_types.h" |
16 | 17 |
17 namespace sandbox { | 18 namespace sandbox { |
18 | 19 |
19 class SharedMemIPCServer; | 20 class SharedMemIPCServer; |
20 class ThreadProvider; | 21 class ThreadProvider; |
21 | 22 |
22 // TargetProcess models a target instance (child process). Objects of this | 23 // TargetProcess models a target instance (child process). Objects of this |
23 // class are owned by the Policy used to create them. | 24 // class are owned by the Policy used to create them. |
24 class TargetProcess { | 25 class TargetProcess { |
25 public: | 26 public: |
26 // The constructor takes ownership of |initial_token| and |lockdown_token|. | 27 // The constructor takes ownership of |initial_token| and |lockdown_token|. |
27 TargetProcess(HANDLE initial_token, HANDLE lockdown_token, HANDLE job, | 28 TargetProcess(HANDLE initial_token, HANDLE lockdown_token, HANDLE job, |
28 ThreadProvider* thread_pool); | 29 ThreadProvider* thread_pool); |
29 ~TargetProcess(); | 30 ~TargetProcess(); |
30 | 31 |
31 // TODO(cpu): Currently there does not seem to be a reason to implement | 32 // TODO(cpu): Currently there does not seem to be a reason to implement |
32 // reference counting for this class since is internal, but kept the | 33 // reference counting for this class since is internal, but kept the |
33 // the same interface so the interception framework does not need to be | 34 // the same interface so the interception framework does not need to be |
34 // touched at this point. | 35 // touched at this point. |
35 void AddRef() {} | 36 void AddRef() {} |
36 void Release() {} | 37 void Release() {} |
37 | 38 |
38 // Creates the new target process. The process is created suspended. | 39 // Creates the new target process. The process is created suspended. |
39 DWORD Create(const wchar_t* exe_path, | 40 DWORD Create(const wchar_t* exe_path, |
40 const wchar_t* command_line, | 41 const wchar_t* command_line, |
41 const wchar_t* desktop, | 42 base::win::StartupInformation* startup_info, |
rvargas (doing something else)
2012/08/27 17:56:22
const SI& (preferred)? or const SI*
jschuh
2012/08/27 19:10:19
Done.
| |
42 base::win::ScopedProcessInformation* target_info); | 43 base::win::ScopedProcessInformation* target_info); |
43 | 44 |
44 // Destroys the target process. | 45 // Destroys the target process. |
45 void Terminate(); | 46 void Terminate(); |
46 | 47 |
47 // Creates the IPC objects such as the BrokerDispatcher and the | 48 // Creates the IPC objects such as the BrokerDispatcher and the |
48 // IPC server. The IPC server uses the services of the thread_pool. | 49 // IPC server. The IPC server uses the services of the thread_pool. |
49 DWORD Init(Dispatcher* ipc_dispatcher, void* policy, | 50 DWORD Init(Dispatcher* ipc_dispatcher, void* policy, |
50 uint32 shared_IPC_size, uint32 shared_policy_size); | 51 uint32 shared_IPC_size, uint32 shared_policy_size); |
51 | 52 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 }; | 114 }; |
114 | 115 |
115 // Creates a mock TargetProcess used for testing interceptions. | 116 // Creates a mock TargetProcess used for testing interceptions. |
116 // TODO(cpu): It seems that this method is not going to be used anymore. | 117 // TODO(cpu): It seems that this method is not going to be used anymore. |
117 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address); | 118 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address); |
118 | 119 |
119 | 120 |
120 } // namespace sandbox | 121 } // namespace sandbox |
121 | 122 |
122 #endif // SANDBOX_SRC_TARGET_PROCESS_H__ | 123 #endif // SANDBOX_SRC_TARGET_PROCESS_H__ |
OLD | NEW |