security/sandbox/win/src/named_pipe_policy.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/sandbox/win/src/named_pipe_policy.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     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_NAMED_PIPE_POLICY_H__
     1.9 +#define SANDBOX_SRC_NAMED_PIPE_POLICY_H__
    1.10 +
    1.11 +#include <string>
    1.12 +
    1.13 +#include "base/basictypes.h"
    1.14 +#include "sandbox/win/src/crosscall_server.h"
    1.15 +#include "sandbox/win/src/policy_low_level.h"
    1.16 +#include "sandbox/win/src/sandbox_policy.h"
    1.17 +
    1.18 +namespace sandbox {
    1.19 +
    1.20 +enum EvalResult;
    1.21 +
    1.22 +// This class centralizes most of the knowledge related to named pipe creation.
    1.23 +class NamedPipePolicy {
    1.24 + public:
    1.25 +  // Creates the required low-level policy rules to evaluate a high-level.
    1.26 +  // policy rule for named pipe creation
    1.27 +  // 'name' is the named pipe to be created
    1.28 +  // 'semantics' is the desired semantics.
    1.29 +  // 'policy' is the policy generator to which the rules are going to be added.
    1.30 +  static bool GenerateRules(const wchar_t* name,
    1.31 +                            TargetPolicy::Semantics semantics,
    1.32 +                            LowLevelPolicy* policy);
    1.33 +
    1.34 +  // Processes a 'CreateNamedPipeW()' request from the target.
    1.35 +  static DWORD CreateNamedPipeAction(EvalResult eval_result,
    1.36 +                                     const ClientInfo& client_info,
    1.37 +                                     const std::wstring &name,
    1.38 +                                     DWORD open_mode, DWORD pipe_mode,
    1.39 +                                     DWORD max_instances,
    1.40 +                                     DWORD out_buffer_size,
    1.41 +                                     DWORD in_buffer_size,
    1.42 +                                     DWORD default_timeout, HANDLE* pipe);
    1.43 +};
    1.44 +
    1.45 +}  // namespace sandbox
    1.46 +
    1.47 +
    1.48 +#endif  // SANDBOX_SRC_NAMED_PIPE_POLICY_H__

mercurial