ReactOS 0.4.16-dev-91-g764881a
mmtypes.h
Go to the documentation of this file.
1/******************************************************************************
2 * Memory manager Types *
3 ******************************************************************************/
5
6#if (NTDDI_VERSION >= NTDDI_WIN2K)
7typedef ULONG NODE_REQUIREMENT;
8#define MM_ANY_NODE_OK 0x80000000
9#endif
10
11#define MM_DONT_ZERO_ALLOCATION 0x00000001
12#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002
13#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004
14#define MM_ALLOCATE_NO_WAIT 0x00000008
15#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010
16#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020
17
18#define MDL_MAPPED_TO_SYSTEM_VA 0x0001
19#define MDL_PAGES_LOCKED 0x0002
20#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
21#define MDL_ALLOCATED_FIXED_SIZE 0x0008
22#define MDL_PARTIAL 0x0010
23#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
24#define MDL_IO_PAGE_READ 0x0040
25#define MDL_WRITE_OPERATION 0x0080
26#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
27#define MDL_FREE_EXTRA_PTES 0x0200
28#define MDL_DESCRIBES_AWE 0x0400
29#define MDL_IO_SPACE 0x0800
30#define MDL_NETWORK_HEADER 0x1000
31#define MDL_MAPPING_CAN_FAIL 0x2000
32#define MDL_ALLOCATED_MUST_SUCCEED 0x4000
33#define MDL_INTERNAL 0x8000
34
35#define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \
36 MDL_PAGES_LOCKED | \
37 MDL_SOURCE_IS_NONPAGED_POOL | \
38 MDL_PARTIAL_HAS_BEEN_MAPPED | \
39 MDL_PARENT_MAPPED_SYSTEM_VA | \
40 MDL_SYSTEM_VA | \
41 MDL_IO_SPACE)
42
43#define FLUSH_MULTIPLE_MAXIMUM 32
44
45/* Section access rights */
46#define SECTION_QUERY 0x0001
47#define SECTION_MAP_WRITE 0x0002
48#define SECTION_MAP_READ 0x0004
49#define SECTION_MAP_EXECUTE 0x0008
50#define SECTION_EXTEND_SIZE 0x0010
51#define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
52
53#define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY| \
54 SECTION_MAP_WRITE | \
55 SECTION_MAP_READ | \
56 SECTION_MAP_EXECUTE | \
57 SECTION_EXTEND_SIZE)
58
59#define SESSION_QUERY_ACCESS 0x0001
60#define SESSION_MODIFY_ACCESS 0x0002
61
62#define SESSION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
63 SESSION_QUERY_ACCESS | \
64 SESSION_MODIFY_ACCESS)
65
66#define SEGMENT_ALL_ACCESS SECTION_ALL_ACCESS
67
68#define PAGE_NOACCESS 0x01
69#define PAGE_READONLY 0x02
70#define PAGE_READWRITE 0x04
71#define PAGE_WRITECOPY 0x08
72#define PAGE_EXECUTE 0x10
73#define PAGE_EXECUTE_READ 0x20
74#define PAGE_EXECUTE_READWRITE 0x40
75#define PAGE_EXECUTE_WRITECOPY 0x80
76#define PAGE_GUARD 0x100
77#define PAGE_NOCACHE 0x200
78#define PAGE_WRITECOMBINE 0x400
79
80#define MEM_COMMIT 0x1000
81#define MEM_RESERVE 0x2000
82#define MEM_DECOMMIT 0x4000
83#define MEM_RELEASE 0x8000
84#define MEM_FREE 0x10000
85#define MEM_PRIVATE 0x20000
86#define MEM_MAPPED 0x40000
87#define MEM_RESET 0x80000
88#define MEM_TOP_DOWN 0x100000
89#define MEM_LARGE_PAGES 0x20000000
90#define MEM_4MB_PAGES 0x80000000
91
92#define SEC_RESERVE 0x4000000
93#define SEC_COMMIT 0x8000000
94#define SEC_LARGE_PAGES 0x80000000
95
96/* Section map options */
97typedef enum _SECTION_INHERIT {
99 ViewUnmap = 2
101
105
106_Struct_size_bytes_(_Inexpressible_(sizeof(struct _MDL) +
108typedef struct _MDL {
109 struct _MDL *Next;
110 CSHORT Size;
111 CSHORT MdlFlags;
112 struct _EPROCESS *Process;
113 PVOID MappedSystemVa;
114 PVOID StartVa;
118#if (_MSC_VER >= 1600)
119typedef _Readable_bytes_(_Inexpressible_(polymorphism)) MDL *PMDLX;
120#else
121typedef MDL *PMDLX;
122#endif
123
127
137
138typedef enum _MM_PAGE_PRIORITY {
143
144typedef enum _MM_SYSTEM_SIZE {
149
150#ifndef _NTSYSTEM_
153#endif
155
157$if (_NTDDK_)
158
159typedef struct _PHYSICAL_MEMORY_RANGE {
163
164typedef NTSTATUS
166 _In_ PMDL DestinationMdl,
167 _In_ PMDL SourceMdl,
169
177
179$if (_NTIFS_)
180typedef enum _MMFLUSH_TYPE {
181 MmFlushForDelete,
182 MmFlushForWrite
184
185typedef struct _READ_LIST {
188 LOGICAL IsImage;
191
192#if (NTDDI_VERSION >= NTDDI_WINXP)
193
194typedef union _MM_PREFETCH_FLAGS {
195 struct {
201
202#define MM_PREFETCH_FLAGS_MASK ((1 << (2*SYSTEM_PAGE_PRIORITY_BITS)) - 1)
203
204#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
205
206#define HEAP_NO_SERIALIZE 0x00000001
207#define HEAP_GROWABLE 0x00000002
208#define HEAP_GENERATE_EXCEPTIONS 0x00000004
209#define HEAP_ZERO_MEMORY 0x00000008
210#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
211#define HEAP_TAIL_CHECKING_ENABLED 0x00000020
212#define HEAP_FREE_CHECKING_ENABLED 0x00000040
213#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
214
215#define HEAP_CREATE_ALIGN_16 0x00010000
216#define HEAP_CREATE_ENABLE_TRACING 0x00020000
217#define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
218
219#define HEAP_SETTABLE_USER_VALUE 0x00000100
220#define HEAP_SETTABLE_USER_FLAG1 0x00000200
221#define HEAP_SETTABLE_USER_FLAG2 0x00000400
222#define HEAP_SETTABLE_USER_FLAG3 0x00000800
223#define HEAP_SETTABLE_USER_FLAGS 0x00000E00
224
225#define HEAP_CLASS_0 0x00000000
226#define HEAP_CLASS_1 0x00001000
227#define HEAP_CLASS_2 0x00002000
228#define HEAP_CLASS_3 0x00003000
229#define HEAP_CLASS_4 0x00004000
230#define HEAP_CLASS_5 0x00005000
231#define HEAP_CLASS_6 0x00006000
232#define HEAP_CLASS_7 0x00007000
233#define HEAP_CLASS_8 0x00008000
234#define HEAP_CLASS_MASK 0x0000F000
235
236#define HEAP_MAXIMUM_TAG 0x0FFF
237#define HEAP_GLOBAL_TAG 0x0800
238#define HEAP_PSEUDO_TAG_FLAG 0x8000
239#define HEAP_TAG_SHIFT 18
240#define HEAP_TAG_MASK (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
241
242#define HEAP_CREATE_VALID_MASK (HEAP_NO_SERIALIZE | \
243 HEAP_GROWABLE | \
244 HEAP_GENERATE_EXCEPTIONS | \
245 HEAP_ZERO_MEMORY | \
246 HEAP_REALLOC_IN_PLACE_ONLY | \
247 HEAP_TAIL_CHECKING_ENABLED | \
248 HEAP_FREE_CHECKING_ENABLED | \
249 HEAP_DISABLE_COALESCE_ON_FREE | \
250 HEAP_CLASS_MASK | \
251 HEAP_CREATE_ALIGN_16 | \
252 HEAP_CREATE_ENABLE_TRACING | \
253 HEAP_CREATE_ENABLE_EXECUTE)
255
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NTSTATUS
Definition: precomp.h:21
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
Definition: fatprocs.h:732
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define _NTIFS_
Definition: ifssupp.h:20
_MM_PAGE_PRIORITY
Definition: imports.h:52
#define _Readable_bytes_(size)
Definition: ms_sal.h:635
#define _Struct_size_bytes_(size)
Definition: ms_sal.h:591
#define _In_
Definition: ms_sal.h:308
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define PAGE_SIZE
Definition: mmtypes.h:34
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
enum _SECTION_INHERIT SECTION_INHERIT
_SECTION_INHERIT
Definition: nt_native.h:1277
@ ViewUnmap
Definition: nt_native.h:1279
@ ViewShare
Definition: nt_native.h:1278
#define _NTDDK_
#define SYSTEM_PAGE_PRIORITY_BITS
ULONG PFN_NUMBER
Definition: ke.h:9
PFILE_OBJECT FileObject
Definition: mmtypes.h:186
ULONG NumberOfEntries
Definition: mmtypes.h:187
LOGICAL IsImage
Definition: mmtypes.h:188
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
short CSHORT
Definition: umtypes.h:127
ULONG RepurposePriority
Definition: mmtypes.h:197
struct _MM_PREFETCH_FLAGS::@4132 Flags
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
#define __CREATE_NTOS_DATA_IMPORT_ALIAS(_Name)
#define _WDMDDK_
Definition: wdm.template.h:26
#define NTKERNELAPI
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
Definition: iotypes.h:1099
* PFILE_OBJECT
Definition: iotypes.h:1998
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036
LONG_PTR * PSPFN_NUMBER
Definition: mmtypes.h:103
MMFLUSH_TYPE
Definition: mmtypes.h:183
_MM_ROTATE_DIRECTION
Definition: mmtypes.h:170
@ MmMaximumRotateDirection
Definition: mmtypes.h:175
@ MmToRegularMemoryNoCopy
Definition: mmtypes.h:174
@ MmToRegularMemory
Definition: mmtypes.h:173
@ MmToFrameBufferNoCopy
Definition: mmtypes.h:172
@ MmToFrameBuffer
Definition: mmtypes.h:171
enum _MM_ROTATE_DIRECTION * PMM_ROTATE_DIRECTION
enum _MM_SYSTEM_SIZE MM_SYSTEMSIZE
$if(_WDMDDK_) typedef ULONG NODE_REQUIREMENT
Definition: ke.h:1
MDL
Definition: mmtypes.h:117
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE
* PPHYSICAL_MEMORY_RANGE
Definition: mmtypes.h:162
_MEMORY_CACHING_TYPE
Definition: mmtypes.h:128
@ MmUSWCCached
Definition: mmtypes.h:134
@ MmCached
Definition: mmtypes.h:130
@ MmNonCached
Definition: mmtypes.h:129
@ MmNonCachedUnordered
Definition: mmtypes.h:133
@ MmMaximumCacheType
Definition: mmtypes.h:135
@ MmWriteCombined
Definition: mmtypes.h:131
@ MmHardwareCoherentCached
Definition: mmtypes.h:132
struct _READ_LIST READ_LIST
LONG_PTR SPFN_NUMBER
Definition: mmtypes.h:103
ULONG_PTR * PPFN_NUMBER
Definition: mmtypes.h:104
_MM_SYSTEM_SIZE
Definition: mmtypes.h:144
@ MmLargeSystem
Definition: mmtypes.h:147
@ MmMediumSystem
Definition: mmtypes.h:146
@ MmSmallSystem
Definition: mmtypes.h:145
PHYSICAL_MEMORY_RANGE
Definition: mmtypes.h:162
enum _MM_ROTATE_DIRECTION MM_ROTATE_DIRECTION
NTKERNELAPI PVOID MmBadPointer
NTSTATUS(NTAPI * PMM_ROTATE_COPY_CALLBACK_FUNCTION)(_In_ PMDL DestinationMdl, _In_ PMDL SourceMdl, _In_ PVOID Context)
Definition: mmtypes.h:165
@ NormalPagePriority
Definition: mmtypes.h:140
@ LowPagePriority
Definition: mmtypes.h:139
@ HighPagePriority
Definition: mmtypes.h:141
ULONG PFN_COUNT
Definition: mmtypes.h:102
struct _READ_LIST * PREAD_LIST
PBOOLEAN Mm64BitPhysicalAddress
Definition: mminit.c:20
union _MM_PREFETCH_FLAGS * PMM_PREFETCH_FLAGS
$endif(_WDMDDK_) $if(_NTDDK_) typedef struct _PHYSICAL_MEMORY_RANGE
Definition: mmtypes.h:156
enum _MEMORY_CACHING_TYPE_ORIG MEMORY_CACHING_TYPE_ORIG
enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY
MDL * PMDLX
Definition: mmtypes.h:121
union _MM_PREFETCH_FLAGS MM_PREFETCH_FLAGS
_MEMORY_CACHING_TYPE_ORIG
Definition: mmtypes.h:124
@ MmFrameBufferCached
Definition: mmtypes.h:125
ULONG_PTR PFN_NUMBER
Definition: mmtypes.h:104
* PMDL
Definition: mmtypes.h:117