| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_SRC_SANDBOX_POLICY_BASE_H_ | 5 #ifndef SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
| 6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ | 6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <stddef.h> | |
| 10 #include <stdint.h> | |
| 11 | 9 |
| 12 #include <list> | 10 #include <list> |
| 13 #include <vector> | 11 #include <vector> |
| 14 | 12 |
| 13 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | |
| 17 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 19 #include "base/win/scoped_handle.h" | 17 #include "base/win/scoped_handle.h" |
| 20 #include "sandbox/win/src/crosscall_server.h" | 18 #include "sandbox/win/src/crosscall_server.h" |
| 21 #include "sandbox/win/src/handle_closer.h" | 19 #include "sandbox/win/src/handle_closer.h" |
| 22 #include "sandbox/win/src/ipc_tags.h" | 20 #include "sandbox/win/src/ipc_tags.h" |
| 23 #include "sandbox/win/src/policy_engine_opcodes.h" | 21 #include "sandbox/win/src/policy_engine_opcodes.h" |
| 24 #include "sandbox/win/src/policy_engine_params.h" | 22 #include "sandbox/win/src/policy_engine_params.h" |
| 25 #include "sandbox/win/src/sandbox_policy.h" | 23 #include "sandbox/win/src/sandbox_policy.h" |
| 26 #include "sandbox/win/src/win_utils.h" | 24 #include "sandbox/win/src/win_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 class PolicyBase final : public TargetPolicy { | 35 class PolicyBase final : public TargetPolicy { |
| 38 public: | 36 public: |
| 39 PolicyBase(); | 37 PolicyBase(); |
| 40 | 38 |
| 41 // TargetPolicy: | 39 // TargetPolicy: |
| 42 void AddRef() override; | 40 void AddRef() override; |
| 43 void Release() override; | 41 void Release() override; |
| 44 ResultCode SetTokenLevel(TokenLevel initial, TokenLevel lockdown) override; | 42 ResultCode SetTokenLevel(TokenLevel initial, TokenLevel lockdown) override; |
| 45 TokenLevel GetInitialTokenLevel() const override; | 43 TokenLevel GetInitialTokenLevel() const override; |
| 46 TokenLevel GetLockdownTokenLevel() const override; | 44 TokenLevel GetLockdownTokenLevel() const override; |
| 47 ResultCode SetJobLevel(JobLevel job_level, uint32_t ui_exceptions) override; | 45 ResultCode SetJobLevel(JobLevel job_level, uint32 ui_exceptions) override; |
| 48 ResultCode SetJobMemoryLimit(size_t memory_limit) override; | 46 ResultCode SetJobMemoryLimit(size_t memory_limit) override; |
| 49 ResultCode SetAlternateDesktop(bool alternate_winstation) override; | 47 ResultCode SetAlternateDesktop(bool alternate_winstation) override; |
| 50 base::string16 GetAlternateDesktop() const override; | 48 base::string16 GetAlternateDesktop() const override; |
| 51 ResultCode CreateAlternateDesktop(bool alternate_winstation) override; | 49 ResultCode CreateAlternateDesktop(bool alternate_winstation) override; |
| 52 void DestroyAlternateDesktop() override; | 50 void DestroyAlternateDesktop() override; |
| 53 ResultCode SetIntegrityLevel(IntegrityLevel integrity_level) override; | 51 ResultCode SetIntegrityLevel(IntegrityLevel integrity_level) override; |
| 54 IntegrityLevel GetIntegrityLevel() const override; | 52 IntegrityLevel GetIntegrityLevel() const override; |
| 55 ResultCode SetDelayedIntegrityLevel(IntegrityLevel integrity_level) override; | 53 ResultCode SetDelayedIntegrityLevel(IntegrityLevel integrity_level) override; |
| 56 ResultCode SetAppContainer(const wchar_t* sid) override; | 54 ResultCode SetAppContainer(const wchar_t* sid) override; |
| 57 ResultCode SetCapability(const wchar_t* sid) override; | 55 ResultCode SetCapability(const wchar_t* sid) override; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // Maintains the list of target process associated with this policy. | 122 // Maintains the list of target process associated with this policy. |
| 125 // The policy takes ownership of them. | 123 // The policy takes ownership of them. |
| 126 typedef std::list<TargetProcess*> TargetSet; | 124 typedef std::list<TargetProcess*> TargetSet; |
| 127 TargetSet targets_; | 125 TargetSet targets_; |
| 128 // Standard object-lifetime reference counter. | 126 // Standard object-lifetime reference counter. |
| 129 volatile LONG ref_count; | 127 volatile LONG ref_count; |
| 130 // The user-defined global policy settings. | 128 // The user-defined global policy settings. |
| 131 TokenLevel lockdown_level_; | 129 TokenLevel lockdown_level_; |
| 132 TokenLevel initial_level_; | 130 TokenLevel initial_level_; |
| 133 JobLevel job_level_; | 131 JobLevel job_level_; |
| 134 uint32_t ui_exceptions_; | 132 uint32 ui_exceptions_; |
| 135 size_t memory_limit_; | 133 size_t memory_limit_; |
| 136 bool use_alternate_desktop_; | 134 bool use_alternate_desktop_; |
| 137 bool use_alternate_winstation_; | 135 bool use_alternate_winstation_; |
| 138 // Helps the file system policy initialization. | 136 // Helps the file system policy initialization. |
| 139 bool file_system_init_; | 137 bool file_system_init_; |
| 140 bool relaxed_interceptions_; | 138 bool relaxed_interceptions_; |
| 141 HANDLE stdout_handle_; | 139 HANDLE stdout_handle_; |
| 142 HANDLE stderr_handle_; | 140 HANDLE stderr_handle_; |
| 143 IntegrityLevel integrity_level_; | 141 IntegrityLevel integrity_level_; |
| 144 IntegrityLevel delayed_integrity_level_; | 142 IntegrityLevel delayed_integrity_level_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 168 // This list contains handles other than the stderr/stdout handles which are | 166 // This list contains handles other than the stderr/stdout handles which are |
| 169 // shared with the target at times. | 167 // shared with the target at times. |
| 170 HandleList handles_to_share_; | 168 HandleList handles_to_share_; |
| 171 | 169 |
| 172 DISALLOW_COPY_AND_ASSIGN(PolicyBase); | 170 DISALLOW_COPY_AND_ASSIGN(PolicyBase); |
| 173 }; | 171 }; |
| 174 | 172 |
| 175 } // namespace sandbox | 173 } // namespace sandbox |
| 176 | 174 |
| 177 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ | 175 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
| OLD | NEW |