1 /******************************************************************************
2 * Memory manager Types *
3 ******************************************************************************/
5 #define MM_DONT_ZERO_ALLOCATION 0x00000001
6 #define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002
7 #define MM_ALLOCATE_FULLY_REQUIRED 0x00000004
8 #define MM_ALLOCATE_NO_WAIT 0x00000008
9 #define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010
10 #define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020
12 #define MDL_MAPPED_TO_SYSTEM_VA 0x0001
13 #define MDL_PAGES_LOCKED 0x0002
14 #define MDL_SOURCE_IS_NONPAGED_POOL 0x0004
15 #define MDL_ALLOCATED_FIXED_SIZE 0x0008
16 #define MDL_PARTIAL 0x0010
17 #define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020
18 #define MDL_IO_PAGE_READ 0x0040
19 #define MDL_WRITE_OPERATION 0x0080
20 #define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100
21 #define MDL_FREE_EXTRA_PTES 0x0200
22 #define MDL_DESCRIBES_AWE 0x0400
23 #define MDL_IO_SPACE 0x0800
24 #define MDL_NETWORK_HEADER 0x1000
25 #define MDL_MAPPING_CAN_FAIL 0x2000
26 #define MDL_ALLOCATED_MUST_SUCCEED 0x4000
27 #define MDL_INTERNAL 0x8000
29 #define MDL_MAPPING_FLAGS ( \
30 MDL_MAPPED_TO_SYSTEM_VA | \
32 MDL_SOURCE_IS_NONPAGED_POOL | \
33 MDL_PARTIAL_HAS_BEEN_MAPPED | \
34 MDL_PARENT_MAPPED_SYSTEM_VA | \
38 #define FLUSH_MULTIPLE_MAXIMUM 32
40 /* Section access rights */
41 #define SECTION_QUERY 0x0001
42 #define SECTION_MAP_WRITE 0x0002
43 #define SECTION_MAP_READ 0x0004
44 #define SECTION_MAP_EXECUTE 0x0008
45 #define SECTION_EXTEND_SIZE 0x0010
46 #define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
48 #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY|\
51 SECTION_MAP_EXECUTE | \
54 #define SESSION_QUERY_ACCESS 0x0001
55 #define SESSION_MODIFY_ACCESS 0x0002
57 #define SESSION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
58 SESSION_QUERY_ACCESS | \
59 SESSION_MODIFY_ACCESS)
61 #define SEGMENT_ALL_ACCESS SECTION_ALL_ACCESS
63 #define PAGE_NOACCESS 0x01
64 #define PAGE_READONLY 0x02
65 #define PAGE_READWRITE 0x04
66 #define PAGE_WRITECOPY 0x08
67 #define PAGE_EXECUTE 0x10
68 #define PAGE_EXECUTE_READ 0x20
69 #define PAGE_EXECUTE_READWRITE 0x40
70 #define PAGE_EXECUTE_WRITECOPY 0x80
71 #define PAGE_GUARD 0x100
72 #define PAGE_NOCACHE 0x200
73 #define PAGE_WRITECOMBINE 0x400
75 #define MEM_COMMIT 0x1000
76 #define MEM_RESERVE 0x2000
77 #define MEM_DECOMMIT 0x4000
78 #define MEM_RELEASE 0x8000
79 #define MEM_FREE 0x10000
80 #define MEM_PRIVATE 0x20000
81 #define MEM_MAPPED 0x40000
82 #define MEM_RESET 0x80000
83 #define MEM_TOP_DOWN 0x100000
84 #define MEM_LARGE_PAGES 0x20000000
85 #define MEM_4MB_PAGES 0x80000000
87 #define SEC_RESERVE 0x4000000
88 #define SEC_COMMIT 0x8000000
89 #define SEC_LARGE_PAGES 0x80000000
91 /* Section map options */
92 typedef enum _SECTION_INHERIT
{
97 typedef ULONG PFN_COUNT
;
98 typedef LONG_PTR SPFN_NUMBER
, *PSPFN_NUMBER
;
99 typedef ULONG_PTR PFN_NUMBER
, *PPFN_NUMBER
;
101 typedef struct _MDL
{
105 struct _EPROCESS
*Process
;
106 PVOID MappedSystemVa
;
113 typedef enum _MEMORY_CACHING_TYPE_ORIG
{
114 MmFrameBufferCached
= 2
115 } MEMORY_CACHING_TYPE_ORIG
;
117 typedef enum _MEMORY_CACHING_TYPE
{
120 MmWriteCombined
= MmFrameBufferCached
,
121 MmHardwareCoherentCached
,
122 MmNonCachedUnordered
,
125 } MEMORY_CACHING_TYPE
;
127 typedef enum _MM_PAGE_PRIORITY
{
129 NormalPagePriority
= 16,
130 HighPagePriority
= 32
133 typedef enum _LOCK_OPERATION
{
139 typedef enum _MM_SYSTEM_SIZE
{