blob: f65bea32a7bdcd7673f43b6734cd6da25b158910 [file] [log] [blame]
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_WINDOWS_SERVICES_SERVICE_PROGRAM_TEST_SUPPORT_SCOPED_MEDIUM_INTEGRITY_H_
#define CHROME_WINDOWS_SERVICES_SERVICE_PROGRAM_TEST_SUPPORT_SCOPED_MEDIUM_INTEGRITY_H_
// Drops the current thread to medium integrity.
class ScopedMediumIntegrity final {
public:
ScopedMediumIntegrity();
ScopedMediumIntegrity(const ScopedMediumIntegrity&) = delete;
ScopedMediumIntegrity& operator=(const ScopedMediumIntegrity&) = delete;
~ScopedMediumIntegrity();
bool Succeeded() const { return impersonating_; }
private:
bool impersonating_ = false;
};
#endif // CHROME_WINDOWS_SERVICES_SERVICE_PROGRAM_TEST_SUPPORT_SCOPED_MEDIUM_INTEGRITY_H_