libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
DIR_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
44
50class DIR_ACCESS_MASK final : public ACCESS_MASK {
51 public:
59 bool has(DirAccessMaskFlag flag) const { return (value() & flag) == flag; }
60
66 void set(DirAccessMaskFlag flag) { value(value() | flag); }
67
73 void clear(DirAccessMaskFlag flag) { value(value() & ~flag); }
74
75 AccessMaskType type() const override { return DirectoryAccessMask; }
76
77 // Constructors and assignment operators
78 DIR_ACCESS_MASK() = default;
79 DIR_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
80
83};
84
85const std::string& to_string(DirAccessMaskFlag);
86std::ostream& operator<<(std::ostream&, DirAccessMaskFlag);
87
89std::ostream& operator<<(std::ostream&, DIR_ACCESS_MASK);
90
91} /* namespace nt */
92} /* namespace windows */
93} /* 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
@ DirectoryAccessMask
Definition ACCESS_MASK.hh:112
ACCESS_MASK class for directory permissions.
Definition DIR_ACCESS_MASK.hh:50
DIR_ACCESS_MASK & operator=(const DIR_ACCESS_MASK &)=default
AccessMaskType type() const override
Get the type of access mask.
Definition DIR_ACCESS_MASK.hh:75
void clear(DirAccessMaskFlag flag)
Clear the given flag.
Definition DIR_ACCESS_MASK.hh:73
DIR_ACCESS_MASK(const DIR_ACCESS_MASK &)=default
DIR_ACCESS_MASK(uint32_t mask)
Definition DIR_ACCESS_MASK.hh:79
bool has(DirAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition DIR_ACCESS_MASK.hh:59
void set(DirAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition DIR_ACCESS_MASK.hh:66
@ STANDARD_RIGHTS_REQUIRED
Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access.
Definition ACCESS_MASK.hh:67
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
DirAccessMaskFlag
Valid flags for DIR_ACCESS_MASK.
Definition DIR_ACCESS_MASK.hh:32
@ DIRECTORY_CREATE_OBJECT
Name-creation access to the directory object.
Definition DIR_ACCESS_MASK.hh:38
@ DIRECTORY_QUERY
Query access to the directory object.
Definition DIR_ACCESS_MASK.hh:34
@ DIRECTORY_CREATE_SUBDIRECTORY
Subdirectory-creation access to the directory object.
Definition DIR_ACCESS_MASK.hh:40
@ DIRECTORY_TRAVERSE
Name-lookup access to the directory object.
Definition DIR_ACCESS_MASK.hh:36
@ DIRECTORY_ALL_ACCESS
All of the preceding rights plus STANDARD_RIGHTS_REQUIRED.
Definition DIR_ACCESS_MASK.hh:42
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20