Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef SANDBOX_SRC_HANDLE_POLICY_H_ |
michael@0 | 6 | #define SANDBOX_SRC_HANDLE_POLICY_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <string> |
michael@0 | 9 | |
michael@0 | 10 | #include "base/basictypes.h" |
michael@0 | 11 | #include "sandbox/win/src/crosscall_server.h" |
michael@0 | 12 | #include "sandbox/win/src/policy_low_level.h" |
michael@0 | 13 | #include "sandbox/win/src/sandbox_policy.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace sandbox { |
michael@0 | 16 | |
michael@0 | 17 | enum EvalResult; |
michael@0 | 18 | |
michael@0 | 19 | // This class centralizes most of the knowledge related to handle policy. |
michael@0 | 20 | class HandlePolicy { |
michael@0 | 21 | public: |
michael@0 | 22 | // Creates the required low-level policy rules to evaluate a high-level |
michael@0 | 23 | // policy rule for handles, in particular duplicate action. |
michael@0 | 24 | static bool GenerateRules(const wchar_t* type_name, |
michael@0 | 25 | TargetPolicy::Semantics semantics, |
michael@0 | 26 | LowLevelPolicy* policy); |
michael@0 | 27 | |
michael@0 | 28 | // Processes a 'TargetPolicy::DuplicateHandle()' request from the target. |
michael@0 | 29 | static DWORD DuplicateHandleProxyAction(EvalResult eval_result, |
michael@0 | 30 | const ClientInfo& client_info, |
michael@0 | 31 | HANDLE source_handle, |
michael@0 | 32 | DWORD target_process_id, |
michael@0 | 33 | HANDLE* target_handle, |
michael@0 | 34 | DWORD desired_access, |
michael@0 | 35 | DWORD options); |
michael@0 | 36 | }; |
michael@0 | 37 | |
michael@0 | 38 | } // namespace sandbox |
michael@0 | 39 | |
michael@0 | 40 | #endif // SANDBOX_SRC_HANDLE_POLICY_H_ |
michael@0 | 41 |