libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
FILE_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
93
99class FILE_ACCESS_MASK final : public ACCESS_MASK {
100 public:
108 bool has(FileAccessMaskFlag flag) const { return (value() & flag) == flag; }
109
115 void set(FileAccessMaskFlag flag) { value(value() | flag); }
116
122 void clear(FileAccessMaskFlag flag) { value(value() & ~flag); }
123
124 AccessMaskType type() const override { return FileAccessMask; }
125
126 // Constructors and assignment operators
127 FILE_ACCESS_MASK() = default;
128 FILE_ACCESS_MASK(uint32_t mask) : ACCESS_MASK(mask) {}
129
132};
133
134const std::string& to_string(FileAccessMaskFlag);
135std::ostream& operator<<(std::ostream&, FileAccessMaskFlag);
136
138std::ostream& operator<<(std::ostream&, FILE_ACCESS_MASK);
139
140} /* namespace nt */
141} /* namespace windows */
142} /* 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
@ FileAccessMask
Definition ACCESS_MASK.hh:114
ACCESS_MASK class for file permissions.
Definition FILE_ACCESS_MASK.hh:99
void set(FileAccessMaskFlag flag)
Set the state of the given flag to enabled.
Definition FILE_ACCESS_MASK.hh:115
bool has(FileAccessMaskFlag flag) const
Check if the given flag is enabled.
Definition FILE_ACCESS_MASK.hh:108
FILE_ACCESS_MASK & operator=(const FILE_ACCESS_MASK &)=default
FILE_ACCESS_MASK(const FILE_ACCESS_MASK &)=default
AccessMaskType type() const override
Get the type of access mask.
Definition FILE_ACCESS_MASK.hh:124
void clear(FileAccessMaskFlag flag)
Clear the given flag.
Definition FILE_ACCESS_MASK.hh:122
FILE_ACCESS_MASK(uint32_t mask)
Definition FILE_ACCESS_MASK.hh:128
@ STANDARD_RIGHTS_REQUIRED
Combines DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER access.
Definition ACCESS_MASK.hh:67
@ SYNCHRONIZE
Definition ACCESS_MASK.hh:52
@ READ_CONTROL
Definition ACCESS_MASK.hh:41
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
FileAccessMaskFlag
Valid flags for FILE_ACCESS_MASK.
Definition FILE_ACCESS_MASK.hh:33
@ FILE_APPEND_DATA
For a file object, the right to append data to the file.
Definition FILE_ACCESS_MASK.hh:42
@ FILE_DELETE_CHILD
Definition FILE_ACCESS_MASK.hh:74
@ FILE_LIST_DIRECTORY
For a directory, the right to list the contents of the directory.
Definition FILE_ACCESS_MASK.hh:61
@ FILE_READ_EA
The right to read extended file attributes.
Definition FILE_ACCESS_MASK.hh:49
@ FILE_ALL_ACCESS
All possible access rights for a file.
Definition FILE_ACCESS_MASK.hh:80
@ FILE_GENERIC_WRITE
Definition FILE_ACCESS_MASK.hh:90
@ FILE_WRITE_DATA
For a file object, the right to write data to the file.
Definition FILE_ACCESS_MASK.hh:39
@ FILE_TRAVERSE
For a directory, the right to traverse the directory.
Definition FILE_ACCESS_MASK.hh:70
@ FILE_READ_ATTRIBUTES
The right to read file attributes.
Definition FILE_ACCESS_MASK.hh:55
@ FILE_GENERIC_EXECUTE
Generic execute bits for a file.
Definition FILE_ACCESS_MASK.hh:83
@ FILE_ADD_SUBDIRECTORY
For a directory, the right to create a subdirectory.
Definition FILE_ACCESS_MASK.hh:67
@ FILE_WRITE_EA
The right to write extended file attributes.
Definition FILE_ACCESS_MASK.hh:52
@ FILE_GENERIC_READ
Generic read bits for a file.
Definition FILE_ACCESS_MASK.hh:86
@ FILE_CREATE_PIPE_INSTANCE
For a named pipe, the right to create a pipe.
Definition FILE_ACCESS_MASK.hh:77
@ FILE_READ_DATA
Definition FILE_ACCESS_MASK.hh:36
@ FILE_WRITE_ATTRIBUTES
The right to write file attributes.
Definition FILE_ACCESS_MASK.hh:58
@ FILE_ADD_FILE
For a directory, the right to create a file in the directory.
Definition FILE_ACCESS_MASK.hh:64
@ FILE_EXECUTE
Definition FILE_ACCESS_MASK.hh:46
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20