security/sandbox/win/src/registry_policy.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // Copyright (c) 2006-2008 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_REGISTRY_POLICY_H__
michael@0 6 #define SANDBOX_SRC_REGISTRY_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/nt_internals.h"
michael@0 13 #include "sandbox/win/src/policy_low_level.h"
michael@0 14 #include "sandbox/win/src/sandbox_policy.h"
michael@0 15
michael@0 16 namespace sandbox {
michael@0 17
michael@0 18 enum EvalResult;
michael@0 19
michael@0 20 // This class centralizes most of the knowledge related to registry policy
michael@0 21 class RegistryPolicy {
michael@0 22 public:
michael@0 23 // Creates the required low-level policy rules to evaluate a high-level
michael@0 24 // policy rule for registry IO, in particular open or create actions.
michael@0 25 static bool GenerateRules(const wchar_t* name,
michael@0 26 TargetPolicy::Semantics semantics,
michael@0 27 LowLevelPolicy* policy);
michael@0 28
michael@0 29 // Performs the desired policy action on a create request with an
michael@0 30 // API that is compatible with the IPC-received parameters.
michael@0 31 static bool CreateKeyAction(EvalResult eval_result,
michael@0 32 const ClientInfo& client_info,
michael@0 33 const std::wstring &key,
michael@0 34 uint32 attributes,
michael@0 35 HANDLE root_directory,
michael@0 36 uint32 desired_access,
michael@0 37 uint32 title_index,
michael@0 38 uint32 create_options,
michael@0 39 HANDLE* handle,
michael@0 40 NTSTATUS* nt_status,
michael@0 41 ULONG* disposition);
michael@0 42
michael@0 43 // Performs the desired policy action on an open request with an
michael@0 44 // API that is compatible with the IPC-received parameters.
michael@0 45 static bool OpenKeyAction(EvalResult eval_result,
michael@0 46 const ClientInfo& client_info,
michael@0 47 const std::wstring &key,
michael@0 48 uint32 attributes,
michael@0 49 HANDLE root_directory,
michael@0 50 uint32 desired_access,
michael@0 51 HANDLE* handle,
michael@0 52 NTSTATUS* nt_status);
michael@0 53 };
michael@0 54
michael@0 55 } // namespace sandbox
michael@0 56
michael@0 57 #endif // SANDBOX_SRC_REGISTRY_POLICY_H__

mercurial