[go: nahoru, domu]

blob: 8560269a296dbbe9e8309e58ceecd0d504cbdabe [file] [log] [blame]
// Copyright 2006-2010 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_WIN_TESTS_COMMON_TEST_UTILS_H_
#define SANDBOX_WIN_TESTS_COMMON_TEST_UTILS_H_
#include "base/win/access_control_list.h"
#include "base/win/windows_types.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace sandbox {
// Sets a reparse point. |source| will now point to |target|. Returns true if
// the call succeeds, false otherwise.
bool SetReparsePoint(HANDLE source, const wchar_t* target);
// Delete the reparse point referenced by |source|. Returns true if the call
// succeeds, false otherwise.
bool DeleteReparsePoint(HANDLE source);
// Check if a specific SID and access mask is presenting in a DACL.
// `dacl` is the DACL to check.
// `allowed` if true checks for access allowed ACEs, otherwise for deny ACEs.
// `mask` check for a specific access mask. Ignored if the value is empty.
// `sid` the SID to check for.
// Returns true if the SID and access mask is present.
bool IsSidInDacl(const base::win::AccessControlList& dacl,
bool allowed,
absl::optional<ACCESS_MASK> mask,
const base::win::Sid& sid);
} // namespace sandbox
#endif // SANDBOX_WIN_TESTS_COMMON_TEST_UTILS_H_