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_POLICY_PARAMS_H__
6 #define SANDBOX_SRC_POLICY_PARAMS_H__
8 #include "sandbox/win/src/policy_engine_params.h"
14 // Warning: The following macros store the address to the actual variables, in
15 // other words, the values are not copied.
16 #define POLPARAMS_BEGIN(type) class type { public: enum Args {
17 #define POLPARAM(arg) arg,
18 #define POLPARAMS_END(type) PolParamLast }; }; \
19 typedef sandbox::ParameterSet type##Array [type::PolParamLast];
21 // Policy parameters for file open / create.
22 POLPARAMS_BEGIN(OpenFile
)
24 POLPARAM(BROKER
) // TRUE if called from the broker.
27 POLPARAMS_END(OpenFile
)
29 // Policy parameter for name-based policies.
30 POLPARAMS_BEGIN(FileName
)
32 POLPARAM(BROKER
) // TRUE if called from the broker.
33 POLPARAMS_END(FileName
)
35 COMPILE_ASSERT(OpenFile::NAME
== static_cast<int>(FileName::NAME
),
36 to_simplify_fs_policies
);
37 COMPILE_ASSERT(OpenFile::BROKER
== static_cast<int>(FileName::BROKER
),
38 to_simplify_fs_policies
);
40 // Policy parameter for name-based policies.
41 POLPARAMS_BEGIN(NameBased
)
43 POLPARAMS_END(NameBased
)
45 // Policy parameters for open event.
46 POLPARAMS_BEGIN(OpenEventParams
)
49 POLPARAMS_END(OpenEventParams
)
51 // Policy Parameters for reg open / create.
52 POLPARAMS_BEGIN(OpenKey
)
55 POLPARAMS_END(OpenKey
)
57 // Policy parameter for name-based policies.
58 POLPARAMS_BEGIN(HandleTarget
)
61 POLPARAMS_END(HandleTarget
)
64 } // namespace sandbox
66 #endif // SANDBOX_SRC_POLICY_PARAMS_H__