libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
SECTION_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
45
51class SECTION_ACCESS_MASK final : public ACCESS_MASK {
52 public:
60 bool has(SectionAccessMaskFlag flag) const { return (value() & flag) == flag; }
61
67 void set(SectionAccessMaskFlag flag) { value(value() | flag); }
68
74 void clear(SectionAccessMaskFlag flag) { value(value() & ~flag); }
75
76 AccessMaskType type() const override { return SectionAccessMask; }
77
78 // Constructors and assignment operators
80 SECTION_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
81
84};
85
86const std::string& to_string(SectionAccessMaskFlag);
87std::ostream& operator<<(std::ostream&, SectionAccessMaskFlag);
88
90std::ostream& operator<<(std::ostream&, SECTION_ACCESS_MASK);
91
92} /* namespace nt */
93} /* namespace windows */
94} /* 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
@ SectionAccessMask
Definition ACCESS_MASK.hh:118
ACCESS_MASK class for section permissions.
Definition SECTION_ACCESS_MASK.hh:51
SECTION_ACCESS_MASK & operator=(const SECTION_ACCESS_MASK &)=default
bool has(SectionAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition SECTION_ACCESS_MASK.hh:60
void set(SectionAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition SECTION_ACCESS_MASK.hh:67
void clear(SectionAccessMaskFlag flag)
Clear the given flag.
Definition SECTION_ACCESS_MASK.hh:74
AccessMaskType type() const override
Get the type of access mask.
Definition SECTION_ACCESS_MASK.hh:76
SECTION_ACCESS_MASK(uint32_t mask)
Definition SECTION_ACCESS_MASK.hh:80
SECTION_ACCESS_MASK(const SECTION_ACCESS_MASK &)=default
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
SectionAccessMaskFlag
Valid flags for SECTION_ACCESS_MASK.
Definition SECTION_ACCESS_MASK.hh:29
@ SECTION_MAP_READ
Read views of the section.
Definition SECTION_ACCESS_MASK.hh:35
@ SECTION_MAP_EXECUTE_EXPLICIT
Definition SECTION_ACCESS_MASK.hh:40
@ SECTION_QUERY
Query the section object for information about the section. Drivers should set this flag.
Definition SECTION_ACCESS_MASK.hh:31
@ SECTION_MAP_EXECUTE
Execute views of the section.
Definition SECTION_ACCESS_MASK.hh:37
@ SECTION_ALL_ACCESS
All permissions combined with STANDARD_RIGHTS_REQUIRED.
Definition SECTION_ACCESS_MASK.hh:43
@ SECTION_EXTEND_SIZE
Dynamically extend the size of the section.
Definition SECTION_ACCESS_MASK.hh:39
@ SECTION_MAP_WRITE
Write views of the section.
Definition SECTION_ACCESS_MASK.hh:33
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20