libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
THREAD_ACCESS_MASK.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include "ACCESS_MASK.hh"
19
20namespace introvirt {
21namespace windows {
22namespace nt {
23
61
67class THREAD_ACCESS_MASK final : public ACCESS_MASK {
68 public:
76 bool has(ThreadAccessMaskFlag flag) const { return (value() & flag) == flag; }
77
83 void set(ThreadAccessMaskFlag flag) { value(value() | flag); }
84
90 void clear(ThreadAccessMaskFlag flag) { value(value() & ~flag); }
91
92 AccessMaskType type() const override { return ThreadAccessMask; }
93
94 // Constructors and assignment operators
95 THREAD_ACCESS_MASK() = default;
96 THREAD_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
97
100};
101
102const std::string& to_string(ThreadAccessMaskFlag);
103std::ostream& operator<<(std::ostream&, ThreadAccessMaskFlag);
104
106std::ostream& operator<<(std::ostream&, THREAD_ACCESS_MASK);
107
108} /* namespace nt */
109} /* namespace windows */
110} /* namespace introvirt */
Generic ACCESS_MASK type.
Definition ACCESS_MASK.hh:109
uint32_t value() const
Get the raw value.
Definition ACCESS_MASK.hh:155
AccessMaskType
Definition ACCESS_MASK.hh:111
@ ThreadAccessMask
Definition ACCESS_MASK.hh:119
ACCESS_MASK class for thread permissions.
Definition THREAD_ACCESS_MASK.hh:67
void clear(ThreadAccessMaskFlag flag)
Clear the given flag.
Definition THREAD_ACCESS_MASK.hh:90
THREAD_ACCESS_MASK & operator=(const THREAD_ACCESS_MASK &)=default
THREAD_ACCESS_MASK(const THREAD_ACCESS_MASK &)=default
AccessMaskType type() const override
Get the type of access mask.
Definition THREAD_ACCESS_MASK.hh:92
void set(ThreadAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition THREAD_ACCESS_MASK.hh:83
THREAD_ACCESS_MASK(uint32_t mask)
Definition THREAD_ACCESS_MASK.hh:96
bool has(ThreadAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition THREAD_ACCESS_MASK.hh:76
@ STANDARD_RIGHTS_REQUIRED
Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access.
Definition ACCESS_MASK.hh:67
@ SYNCHRONIZE
Definition ACCESS_MASK.hh:52
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
ThreadAccessMaskFlag
Valid flags for THREAD_ACCESS_MASK.
Definition THREAD_ACCESS_MASK.hh:33
@ THREAD_QUERY_INFORMATION
Required to read certain information from the thread object, such as the exit code.
Definition THREAD_ACCESS_MASK.hh:45
@ THREAD_SET_CONTEXT
Required to write the context of a thread using SetThreadContext.
Definition THREAD_ACCESS_MASK.hh:41
@ THREAD_GET_CONTEXT
Required to read the context of a thread using GetThreadContext.
Definition THREAD_ACCESS_MASK.hh:39
@ THREAD_ALL_ACCESS
All possible access rights for a thread object.
Definition THREAD_ACCESS_MASK.hh:59
@ THREAD_TERMINATE
Required to terminate a thread using TerminateThread.
Definition THREAD_ACCESS_MASK.hh:35
@ THREAD_QUERY_LIMITED_INFORMATION
Required to read certain information from the thread objects (see GetProcessIdOfThread).
Definition THREAD_ACCESS_MASK.hh:57
@ THREAD_IMPERSONATE
Definition THREAD_ACCESS_MASK.hh:50
@ THREAD_SET_THREAD_TOKEN
Required to set the impersonation token for a thread using SetThreadToken.
Definition THREAD_ACCESS_MASK.hh:47
@ THREAD_SUSPEND_RESUME
Required to suspend or resume a thread.
Definition THREAD_ACCESS_MASK.hh:37
@ THREAD_SET_INFORMATION
Required to set certain information in the thread object.
Definition THREAD_ACCESS_MASK.hh:43
@ THREAD_DIRECT_IMPERSONATION
Required for a server thread that impersonates a client.
Definition THREAD_ACCESS_MASK.hh:52
@ THREAD_SET_LIMITED_INFORMATION
Definition THREAD_ACCESS_MASK.hh:55
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20