libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
MEMORY_ALLOCATION_TYPE.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 <introvirt/util/json/json.hh>
19
20#include <cstdint>
21#include <string>
22
23namespace introvirt {
24namespace windows {
25namespace nt {
26
35 MEM_COMMIT = 0x00001000,
36 MEM_RESERVE = 0x00002000,
37 MEM_DECOMMIT = 0x00004000,
38 MEM_RELEASE = 0x00008000,
39 MEM_FREE = 0x00010000,
40 MEM_PRIVATE = 0x00020000,
41 MEM_MAPPED = 0x00040000,
42 MEM_RESET = 0x00080000,
43 MEM_TOP_DOWN = 0x00100000,
44 MEM_PHYSICAL = 0x00400000,
45 MEM_IMAGE = 0x1000000,
46 MEM_LARGE_PAGES = 0x20000000,
47 MEM_4MB_PAGES = 0x80000000
48};
49
55 public:
56 bool MEM_COMMIT() const;
57 bool MEM_RESERVE() const;
58 bool MEM_DECOMMIT() const;
59 bool MEM_RELEASE() const;
60 bool MEM_FREE() const;
61 bool MEM_PRIVATE() const;
62 bool MEM_MAPPED() const;
63 bool MEM_RESET() const;
64 bool MEM_TOP_DOWN() const;
65 bool MEM_PHYSICAL() const;
66 bool MEM_IMAGE() const;
67 bool MEM_LARGE_PAGES() const;
68 bool MEM_4MB_PAGES() const;
69
70 void MEM_COMMIT(bool enabled);
71 void MEM_RESERVE(bool enabled);
72 void MEM_DECOMMIT(bool enabled);
73 void MEM_RELEASE(bool enabled);
74 void MEM_FREE(bool enabled);
75 void MEM_PRIVATE(bool enabled);
76 void MEM_MAPPED(bool enabled);
77 void MEM_RESET(bool enabled);
78 void MEM_TOP_DOWN(bool enabled);
79 void MEM_PHYSICAL(bool enabled);
80 void MEM_IMAGE(bool enabled);
81 void MEM_LARGE_PAGES(bool enabled);
82 void MEM_4MB_PAGES(bool enabled);
83
84 std::string string() const;
85 operator Json::Value() const;
86 uint32_t value() const { return value_; }
87 operator uint32_t() const { return value_; }
88 bool operator==(const MEMORY_ALLOCATION_TYPE& other) const;
89 MEMORY_ALLOCATION_TYPE(uint32_t value = 0) : value_(value) {}
90 void stream(std::ostream&) const;
91
92 private:
93 uint32_t value_;
94};
95
96std::ostream& operator<<(std::ostream& os, const MEMORY_ALLOCATION_TYPE& allocationType);
97std::string to_string(const MEMORY_ALLOCATION_TYPE& allocationType);
98
99} // namespace nt
100} // namespace windows
101} // namespace introvirt
Class for MEMORY_ALLOCATION_TYPE flags.
Definition MEMORY_ALLOCATION_TYPE.hh:54
bool operator==(const MEMORY_ALLOCATION_TYPE &other) const
MEMORY_ALLOCATION_TYPE(uint32_t value=0)
Definition MEMORY_ALLOCATION_TYPE.hh:89
uint32_t value() const
Definition MEMORY_ALLOCATION_TYPE.hh:86
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
MEMORY_ALLOCATION_TYPE_FLAGS
Windows memory allocation types.
Definition MEMORY_ALLOCATION_TYPE.hh:34
@ MEM_COMMIT
Definition MEMORY_ALLOCATION_TYPE.hh:35
@ MEM_4MB_PAGES
Definition MEMORY_ALLOCATION_TYPE.hh:47
@ MEM_DECOMMIT
Definition MEMORY_ALLOCATION_TYPE.hh:37
@ MEM_LARGE_PAGES
Definition MEMORY_ALLOCATION_TYPE.hh:46
@ MEM_MAPPED
Definition MEMORY_ALLOCATION_TYPE.hh:41
@ MEM_RESERVE
Definition MEMORY_ALLOCATION_TYPE.hh:36
@ MEM_PRIVATE
Definition MEMORY_ALLOCATION_TYPE.hh:40
@ MEM_IMAGE
Definition MEMORY_ALLOCATION_TYPE.hh:45
@ MEM_TOP_DOWN
Definition MEMORY_ALLOCATION_TYPE.hh:43
@ MEM_FREE
Definition MEMORY_ALLOCATION_TYPE.hh:39
@ MEM_PHYSICAL
Definition MEMORY_ALLOCATION_TYPE.hh:44
@ MEM_RESET
Definition MEMORY_ALLOCATION_TYPE.hh:42
@ MEM_RELEASE
Definition MEMORY_ALLOCATION_TYPE.hh:38
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20