libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
KEY_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
63
69class KEY_ACCESS_MASK final : public ACCESS_MASK {
70 public:
78 bool has(KeyAccessMaskFlag flag) const { return (value() & flag) == flag; }
79
85 void set(KeyAccessMaskFlag flag) { value(value() | flag); }
86
92 void clear(KeyAccessMaskFlag flag) { value(value() & ~flag); }
93
94 AccessMaskType type() const override { return KeyAccessMask; }
95
96 // Constructors and assignment operators
97 KEY_ACCESS_MASK() = default;
98 KEY_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
99
102};
103
104const std::string& to_string(KeyAccessMaskFlag);
105std::ostream& operator<<(std::ostream&, KeyAccessMaskFlag);
106
108std::ostream& operator<<(std::ostream&, KEY_ACCESS_MASK);
109
110} /* namespace nt */
111} /* namespace windows */
112} /* 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
@ KeyAccessMask
Definition ACCESS_MASK.hh:115
ACCESS_MASK class for key permissions.
Definition KEY_ACCESS_MASK.hh:69
void clear(KeyAccessMaskFlag flag)
Clear the given flag.
Definition KEY_ACCESS_MASK.hh:92
void set(KeyAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition KEY_ACCESS_MASK.hh:85
bool has(KeyAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition KEY_ACCESS_MASK.hh:78
KEY_ACCESS_MASK & operator=(const KEY_ACCESS_MASK &)=default
KEY_ACCESS_MASK(uint32_t mask)
Definition KEY_ACCESS_MASK.hh:98
AccessMaskType type() const override
Get the type of access mask.
Definition KEY_ACCESS_MASK.hh:94
KEY_ACCESS_MASK(const KEY_ACCESS_MASK &)=default
KeyAccessMaskFlag
Valid flags for KEY_ACCESS_MASK.
Definition KEY_ACCESS_MASK.hh:33
@ KEY_READ
Definition KEY_ACCESS_MASK.hh:54
@ KEY_ALL_ACCESS
Definition KEY_ACCESS_MASK.hh:61
@ KEY_QUERY_VALUE
Required to query the values of a registry key.
Definition KEY_ACCESS_MASK.hh:35
@ KEY_WOW64_32KEY
Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.
Definition KEY_ACCESS_MASK.hh:50
@ KEY_ENUMERATE_SUB_KEYS
Required to enumerate the subkeys of a registry key.
Definition KEY_ACCESS_MASK.hh:41
@ KEY_CREATE_SUB_KEY
Required to create a subkey of a registry key.
Definition KEY_ACCESS_MASK.hh:39
@ KEY_CREATE_LINK
Reserved for system use.
Definition KEY_ACCESS_MASK.hh:46
@ KEY_WRITE
Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.
Definition KEY_ACCESS_MASK.hh:56
@ KEY_WOW64_64KEY
Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.
Definition KEY_ACCESS_MASK.hh:48
@ KEY_SET_VALUE
Required to create, delete, or set a registry value.
Definition KEY_ACCESS_MASK.hh:37
@ KEY_EXECUTE
Equivalent to KEY_READ.
Definition KEY_ACCESS_MASK.hh:58
@ KEY_NOTIFY
Definition KEY_ACCESS_MASK.hh:44
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20