summaryrefslogtreecommitdiffstatshomepage
path: root/src/sid.hpp
blob: c56bdd0c42fbcaf372dc8ac9a333e0a902845a97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2016 Egor Tensin <egor@tensin.name>
// This file is part of the "Privilege check" project.
// For details, see https://github.com/egor-tensin/privilege-check
// Distributed under the MIT License.

#pragma once

/* clang-format off */
#include <windows.h>
#include <sddl.h>
/* clang-format on */

#include <array>
#include <string>

constexpr DWORD max_sid_size = SECURITY_MAX_SID_SIZE;

typedef std::array<unsigned char, max_sid_size> SidBuffer;

namespace sid {

SidBuffer well_known(WELL_KNOWN_SID_TYPE type);

SidBuffer builtin_administrators();

std::wstring to_string(const SidBuffer&);

} // namespace sid