1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SANDBOX_SRC_REGISTRY_POLICY_H__
6 #define SANDBOX_SRC_REGISTRY_POLICY_H__
10 #include "base/basictypes.h"
11 #include "base/strings/string16.h"
12 #include "sandbox/win/src/crosscall_server.h"
13 #include "sandbox/win/src/nt_internals.h"
14 #include "sandbox/win/src/policy_low_level.h"
15 #include "sandbox/win/src/sandbox_policy.h"
21 // This class centralizes most of the knowledge related to registry policy
22 class RegistryPolicy
{
24 // Creates the required low-level policy rules to evaluate a high-level
25 // policy rule for registry IO, in particular open or create actions.
26 static bool GenerateRules(const wchar_t* name
,
27 TargetPolicy::Semantics semantics
,
28 LowLevelPolicy
* policy
);
30 // Performs the desired policy action on a create request with an
31 // API that is compatible with the IPC-received parameters.
32 static bool CreateKeyAction(EvalResult eval_result
,
33 const ClientInfo
& client_info
,
34 const base::string16
&key
,
36 HANDLE root_directory
,
37 uint32 desired_access
,
39 uint32 create_options
,
44 // Performs the desired policy action on an open request with an
45 // API that is compatible with the IPC-received parameters.
46 static bool OpenKeyAction(EvalResult eval_result
,
47 const ClientInfo
& client_info
,
48 const base::string16
&key
,
50 HANDLE root_directory
,
51 uint32 desired_access
,
56 } // namespace sandbox
58 #endif // SANDBOX_SRC_REGISTRY_POLICY_H__