michael@0: // Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef SANDBOX_SRC_HANDLE_POLICY_H_ michael@0: #define SANDBOX_SRC_HANDLE_POLICY_H_ michael@0: michael@0: #include michael@0: michael@0: #include "base/basictypes.h" michael@0: #include "sandbox/win/src/crosscall_server.h" michael@0: #include "sandbox/win/src/policy_low_level.h" michael@0: #include "sandbox/win/src/sandbox_policy.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: enum EvalResult; michael@0: michael@0: // This class centralizes most of the knowledge related to handle policy. michael@0: class HandlePolicy { michael@0: public: michael@0: // Creates the required low-level policy rules to evaluate a high-level michael@0: // policy rule for handles, in particular duplicate action. michael@0: static bool GenerateRules(const wchar_t* type_name, michael@0: TargetPolicy::Semantics semantics, michael@0: LowLevelPolicy* policy); michael@0: michael@0: // Processes a 'TargetPolicy::DuplicateHandle()' request from the target. michael@0: static DWORD DuplicateHandleProxyAction(EvalResult eval_result, michael@0: const ClientInfo& client_info, michael@0: HANDLE source_handle, michael@0: DWORD target_process_id, michael@0: HANDLE* target_handle, michael@0: DWORD desired_access, michael@0: DWORD options); michael@0: }; michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_HANDLE_POLICY_H_ michael@0: