OLD | NEW |
1 // Copyright (c) 2011 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 // Sandbox is a sandbox library for windows processes. Use when you want a | 5 // Sandbox is a sandbox library for windows processes. Use when you want a |
6 // 'privileged' process and a 'locked down process' to interact with. | 6 // 'privileged' process and a 'locked down process' to interact with. |
7 // The privileged process is called the broker and it is started by external | 7 // The privileged process is called the broker and it is started by external |
8 // means (such as the user starting it). The 'sandboxed' process is called the | 8 // means (such as the user starting it). The 'sandboxed' process is called the |
9 // target and it is started by the broker. There can be many target processes | 9 // target and it is started by the broker. There can be many target processes |
10 // started by a single broker process. This library provides facilities | 10 // started by a single broker process. This library provides facilities |
11 // for both the broker and the target. | 11 // for both the broker and the target. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Discards the impersonation token and uses the lower token, call before | 120 // Discards the impersonation token and uses the lower token, call before |
121 // processing any untrusted data or running third-party code. If this call | 121 // processing any untrusted data or running third-party code. If this call |
122 // fails the current process could be terminated immediately. | 122 // fails the current process could be terminated immediately. |
123 virtual void LowerToken() = 0; | 123 virtual void LowerToken() = 0; |
124 | 124 |
125 // Returns the ProcessState object. Through that object it's possible to have | 125 // Returns the ProcessState object. Through that object it's possible to have |
126 // information about the current state of the process, such as whether | 126 // information about the current state of the process, such as whether |
127 // LowerToken has been called or not. | 127 // LowerToken has been called or not. |
128 virtual ProcessState* GetState() = 0; | 128 virtual ProcessState* GetState() = 0; |
| 129 |
| 130 // Requests the broker to duplicate the supplied handle into the target |
| 131 // process. The target process must be an active sandbox child process |
| 132 // and the source process must have a corresponding policy allowing |
| 133 // handle duplication for this object type. |
| 134 // Returns: |
| 135 // ALL_OK if successful. All other return values imply failure. |
| 136 // If the return is ERROR_GENERIC, you can call ::GetLastError() to get |
| 137 // more information. |
| 138 virtual ResultCode DuplicateHandle(HANDLE source_handle, |
| 139 DWORD target_process_id, |
| 140 HANDLE* target_handle, |
| 141 DWORD desired_access, |
| 142 DWORD options) = 0; |
129 }; | 143 }; |
130 | 144 |
131 } // namespace sandbox | 145 } // namespace sandbox |
132 | 146 |
133 | 147 |
134 #endif // SANDBOX_SRC_SANDBOX_H__ | 148 #endif // SANDBOX_SRC_SANDBOX_H__ |
OLD | NEW |