blob: 509a15c781d1a020f54f69ca28de7dcac1ea520b (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright (c) 2016 Egor Tensin <Egor.Tensin@gmail.com>
// 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
#include "handle.hpp"
#include "sid.hpp"
#include <Windows.h>
#include <string>
namespace token
{
namespace permissions
{
constexpr DWORD query() { return TOKEN_QUERY; }
constexpr DWORD duplicate() { return TOKEN_DUPLICATE; }
}
constexpr DWORD default_permissions = permissions::query();
// Current thread's primary impersonation token.
inline Handle dumb() { return Handle{NULL}; }
Handle open_for_process(
const Handle& process,
DWORD permissions = default_permissions);
Handle open_for_current_process(
DWORD permissions = default_permissions);
bool get_linked(Handle& token);
Handle get_for_identification(const Handle& token);
DWORD query_integrity_level(const Handle& token);
std::wstring integrity_level_to_string(DWORD);
bool check_belongs(const Handle& token, const SidBuffer& sid);
bool query_elevation(const Handle& token);
}
|