| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_SANDBOX_POLICY_H_ | 5 #ifndef SANDBOX_SRC_SANDBOX_POLICY_H_ |
| 6 #define SANDBOX_SRC_SANDBOX_POLICY_H_ | 6 #define SANDBOX_SRC_SANDBOX_POLICY_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 9 #include "sandbox/src/sandbox_types.h" | 11 #include "sandbox/src/sandbox_types.h" |
| 10 #include "sandbox/src/security_level.h" | 12 #include "sandbox/src/security_level.h" |
| 11 | 13 |
| 12 namespace sandbox { | 14 namespace sandbox { |
| 13 | 15 |
| 14 class TargetPolicy { | 16 class TargetPolicy { |
| 15 public: | 17 public: |
| 16 // Increments the reference count of this object. The reference count must | 18 // Increments the reference count of this object. The reference count must |
| 17 // be incremented if this interface is given to another component. | 19 // be incremented if this interface is given to another component. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Return value: SBOX_ALL_OK if the setting succeeds and false otherwise. | 75 // Return value: SBOX_ALL_OK if the setting succeeds and false otherwise. |
| 74 // | 76 // |
| 75 // Note: JOB_OBJECT_XXXX constants are defined in winnt.h and documented at | 77 // Note: JOB_OBJECT_XXXX constants are defined in winnt.h and documented at |
| 76 // length in: | 78 // length in: |
| 77 // http://msdn2.microsoft.com/en-us/library/ms684152.aspx | 79 // http://msdn2.microsoft.com/en-us/library/ms684152.aspx |
| 78 // | 80 // |
| 79 // Note: the recommended level is JOB_RESTRICTED or JOB_LOCKDOWN. | 81 // Note: the recommended level is JOB_RESTRICTED or JOB_LOCKDOWN. |
| 80 virtual ResultCode SetJobLevel(JobLevel job_level, uint32 ui_exceptions) = 0; | 82 virtual ResultCode SetJobLevel(JobLevel job_level, uint32 ui_exceptions) = 0; |
| 81 | 83 |
| 82 // Specifies the desktop on which the application is going to run. If the | 84 // Specifies the desktop on which the application is going to run. If the |
| 83 // desktop does not exist, it will be created. | 85 // desktop does not exist, it will be created. If alternate_winstation is |
| 84 virtual ResultCode SetDesktop(const wchar_t* desktop) = 0; | 86 // set to true, the desktop will be created on an alternate window station. |
| 87 virtual ResultCode SetAlternateDesktop(bool alternate_winstation) = 0; |
| 88 |
| 89 // Returns the name of the alternate desktop used. If an alternate window |
| 90 // station is specified, the name is prepended by the window station name, |
| 91 // followed by a backslash. |
| 92 virtual std::wstring GetAlternateDesktop() const = 0; |
| 93 |
| 94 // Precreates the desktop and window station, if any. |
| 95 virtual ResultCode CreateAlternateDesktop(bool alternate_winstation) = 0; |
| 96 |
| 97 // Destroys the desktop and windows station. |
| 98 virtual void DestroyAlternateDesktop() = 0; |
| 85 | 99 |
| 86 // Sets the integrity level of the process in the sandbox. The integrity level | 100 // Sets the integrity level of the process in the sandbox. The integrity level |
| 87 // will not take effect before you call LowerToken. User Interface Privilege | 101 // will not take effect before you call LowerToken. User Interface Privilege |
| 88 // Isolation is not affected by this setting and will remain off for the | 102 // Isolation is not affected by this setting and will remain off for the |
| 89 // process in the sandbox. This flag is valid on Vista only, it is silently | 103 // process in the sandbox. This flag is valid on Vista only, it is silently |
| 90 // ignored on other OSes. If you set the integrity level to a level higher | 104 // ignored on other OSes. If you set the integrity level to a level higher |
| 91 // than your current level, the sandbox will fail to start. | 105 // than your current level, the sandbox will fail to start. |
| 92 virtual ResultCode SetDelayedIntegrityLevel(IntegrityLevel level) = 0; | 106 virtual ResultCode SetDelayedIntegrityLevel(IntegrityLevel level) = 0; |
| 93 | 107 |
| 94 // Sets the integrity level of the process in the sandbox. Both the initial | 108 // Sets the integrity level of the process in the sandbox. Both the initial |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Adds a dll that will be unloaded in the target process before it gets | 171 // Adds a dll that will be unloaded in the target process before it gets |
| 158 // a chance to initialize itself. Typically, dlls that cause the target | 172 // a chance to initialize itself. Typically, dlls that cause the target |
| 159 // to crash go here. | 173 // to crash go here. |
| 160 virtual ResultCode AddDllToUnload(const wchar_t* dll_name) = 0; | 174 virtual ResultCode AddDllToUnload(const wchar_t* dll_name) = 0; |
| 161 }; | 175 }; |
| 162 | 176 |
| 163 } // namespace sandbox | 177 } // namespace sandbox |
| 164 | 178 |
| 165 | 179 |
| 166 #endif // SANDBOX_SRC_SANDBOX_POLICY_H_ | 180 #endif // SANDBOX_SRC_SANDBOX_POLICY_H_ |
| OLD | NEW |