security/sandbox/win/src/policy_params.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/win/src/policy_params.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
     1.5 +// Use of this source code is governed by a BSD-style license that can be
     1.6 +// found in the LICENSE file.
     1.7 +
     1.8 +#ifndef SANDBOX_SRC_POLICY_PARAMS_H__
     1.9 +#define SANDBOX_SRC_POLICY_PARAMS_H__
    1.10 +
    1.11 +#include "sandbox/win/src/policy_engine_params.h"
    1.12 +
    1.13 +namespace sandbox {
    1.14 +
    1.15 +class ParameterSet;
    1.16 +
    1.17 +// Warning: The following macros store the address to the actual variables, in
    1.18 +// other words, the values are not copied.
    1.19 +#define POLPARAMS_BEGIN(type) class type { public: enum Args {
    1.20 +#define POLPARAM(arg) arg,
    1.21 +#define POLPARAMS_END(type) PolParamLast }; }; \
    1.22 +  typedef sandbox::ParameterSet type##Array [type::PolParamLast];
    1.23 +
    1.24 +// Policy parameters for file open / create.
    1.25 +POLPARAMS_BEGIN(OpenFile)
    1.26 +  POLPARAM(NAME)
    1.27 +  POLPARAM(BROKER)   // TRUE if called from the broker.
    1.28 +  POLPARAM(ACCESS)
    1.29 +  POLPARAM(OPTIONS)
    1.30 +POLPARAMS_END(OpenFile)
    1.31 +
    1.32 +// Policy parameter for name-based policies.
    1.33 +POLPARAMS_BEGIN(FileName)
    1.34 +  POLPARAM(NAME)
    1.35 +  POLPARAM(BROKER)   // TRUE if called from the broker.
    1.36 +POLPARAMS_END(FileName)
    1.37 +
    1.38 +COMPILE_ASSERT(OpenFile::NAME == static_cast<int>(FileName::NAME),
    1.39 +               to_simplify_fs_policies);
    1.40 +COMPILE_ASSERT(OpenFile::BROKER == static_cast<int>(FileName::BROKER),
    1.41 +               to_simplify_fs_policies);
    1.42 +
    1.43 +// Policy parameter for name-based policies.
    1.44 +POLPARAMS_BEGIN(NameBased)
    1.45 +  POLPARAM(NAME)
    1.46 +POLPARAMS_END(NameBased)
    1.47 +
    1.48 +// Policy parameters for open event.
    1.49 +POLPARAMS_BEGIN(OpenEventParams)
    1.50 +  POLPARAM(NAME)
    1.51 +  POLPARAM(ACCESS)
    1.52 +POLPARAMS_END(OpenEventParams)
    1.53 +
    1.54 +// Policy Parameters for reg open / create.
    1.55 +POLPARAMS_BEGIN(OpenKey)
    1.56 +  POLPARAM(NAME)
    1.57 +  POLPARAM(ACCESS)
    1.58 +POLPARAMS_END(OpenKey)
    1.59 +
    1.60 +// Policy parameter for name-based policies.
    1.61 +POLPARAMS_BEGIN(HandleTarget)
    1.62 +  POLPARAM(NAME)
    1.63 +  POLPARAM(TARGET)
    1.64 +POLPARAMS_END(HandleTarget)
    1.65 +
    1.66 +
    1.67 +}  // namespace sandbox
    1.68 +
    1.69 +#endif  // SANDBOX_SRC_POLICY_PARAMS_H__

mercurial