michael@0: // Copyright (c) 2006-2008 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_POLICY_PARAMS_H__ michael@0: #define SANDBOX_SRC_POLICY_PARAMS_H__ michael@0: michael@0: #include "sandbox/win/src/policy_engine_params.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: class ParameterSet; michael@0: michael@0: // Warning: The following macros store the address to the actual variables, in michael@0: // other words, the values are not copied. michael@0: #define POLPARAMS_BEGIN(type) class type { public: enum Args { michael@0: #define POLPARAM(arg) arg, michael@0: #define POLPARAMS_END(type) PolParamLast }; }; \ michael@0: typedef sandbox::ParameterSet type##Array [type::PolParamLast]; michael@0: michael@0: // Policy parameters for file open / create. michael@0: POLPARAMS_BEGIN(OpenFile) michael@0: POLPARAM(NAME) michael@0: POLPARAM(BROKER) // TRUE if called from the broker. michael@0: POLPARAM(ACCESS) michael@0: POLPARAM(OPTIONS) michael@0: POLPARAMS_END(OpenFile) michael@0: michael@0: // Policy parameter for name-based policies. michael@0: POLPARAMS_BEGIN(FileName) michael@0: POLPARAM(NAME) michael@0: POLPARAM(BROKER) // TRUE if called from the broker. michael@0: POLPARAMS_END(FileName) michael@0: michael@0: COMPILE_ASSERT(OpenFile::NAME == static_cast(FileName::NAME), michael@0: to_simplify_fs_policies); michael@0: COMPILE_ASSERT(OpenFile::BROKER == static_cast(FileName::BROKER), michael@0: to_simplify_fs_policies); michael@0: michael@0: // Policy parameter for name-based policies. michael@0: POLPARAMS_BEGIN(NameBased) michael@0: POLPARAM(NAME) michael@0: POLPARAMS_END(NameBased) michael@0: michael@0: // Policy parameters for open event. michael@0: POLPARAMS_BEGIN(OpenEventParams) michael@0: POLPARAM(NAME) michael@0: POLPARAM(ACCESS) michael@0: POLPARAMS_END(OpenEventParams) michael@0: michael@0: // Policy Parameters for reg open / create. michael@0: POLPARAMS_BEGIN(OpenKey) michael@0: POLPARAM(NAME) michael@0: POLPARAM(ACCESS) michael@0: POLPARAMS_END(OpenKey) michael@0: michael@0: // Policy parameter for name-based policies. michael@0: POLPARAMS_BEGIN(HandleTarget) michael@0: POLPARAM(NAME) michael@0: POLPARAM(TARGET) michael@0: POLPARAMS_END(HandleTarget) michael@0: michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_POLICY_PARAMS_H__