ReactOS  0.4.15-dev-2526-g0fb3c1e
mm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <internal/arch/mm.h>
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /* TYPES *********************************************************************/
10 
11 struct _EPROCESS;
12 
22 extern ULONG MmThrottleTop;
23 extern ULONG MmThrottleBottom;
24 
26 
28 
30 
34 extern PVOID KernelVerifier;
36 
39 extern SIZE_T MmSharedCommit;
40 extern SIZE_T MmDriverCommit;
41 extern SIZE_T MmProcessCommit;
45 
46 extern PVOID MiDebugMapping; // internal
47 extern PMMPTE MmDebugPte; // internal
48 
49 struct _KTRAP_FRAME;
50 struct _EPROCESS;
52 typedef ULONG_PTR SWAPENTRY;
53 
54 //
55 // MmDbgCopyMemory Flags
56 //
57 #define MMDBG_COPY_WRITE 0x00000001
58 #define MMDBG_COPY_PHYSICAL 0x00000002
59 #define MMDBG_COPY_UNSAFE 0x00000004
60 #define MMDBG_COPY_CACHED 0x00000008
61 #define MMDBG_COPY_UNCACHED 0x00000010
62 #define MMDBG_COPY_WRITE_COMBINED 0x00000020
63 
64 //
65 // Maximum chunk size per copy
66 //
67 #define MMDBG_COPY_MAX_SIZE 0x8
68 
69 #if defined(_X86_) // intenal for marea.c
70 #define MI_STATIC_MEMORY_AREAS (14)
71 #else
72 #define MI_STATIC_MEMORY_AREAS (13)
73 #endif
74 
75 #define MEMORY_AREA_SECTION_VIEW (1)
76 #ifdef NEWCC
77 #define MEMORY_AREA_CACHE (2)
78 #endif
79 #define MEMORY_AREA_OWNED_BY_ARM3 (15)
80 #define MEMORY_AREA_STATIC (0x80000000)
81 
82 /* Although Microsoft says this isn't hardcoded anymore,
83  they won't be able to change it. Stuff depends on it */
84 #define MM_VIRTMEM_GRANULARITY (64 * 1024)
85 
86 #define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
87 
88 /*
89  * Additional flags for protection attributes
90  */
91 #define PAGE_WRITETHROUGH (1024)
92 #define PAGE_SYSTEM (2048)
93 
94 #define SEC_PHYSICALMEMORY (0x80000000)
95 
96 #define MC_USER (0)
97 #define MC_SYSTEM (1)
98 #define MC_MAXIMUM (2)
99 
100 #define PAGED_POOL_MASK 1
101 #define MUST_SUCCEED_POOL_MASK 2
102 #define CACHE_ALIGNED_POOL_MASK 4
103 #define QUOTA_POOL_MASK 8
104 #define SESSION_POOL_MASK 32
105 #define VERIFIER_POOL_MASK 64
106 
107 #define MAX_PAGING_FILES (16)
108 
109 // FIXME: use ALIGN_UP_BY
110 #define MM_ROUND_UP(x,s) \
111  ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
112 
113 #define MM_ROUND_DOWN(x,s) \
114  ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
115 
116 #define PAGE_FLAGS_VALID_FOR_SECTION \
117  (PAGE_READONLY | \
118  PAGE_READWRITE | \
119  PAGE_WRITECOPY | \
120  PAGE_EXECUTE | \
121  PAGE_EXECUTE_READ | \
122  PAGE_EXECUTE_READWRITE | \
123  PAGE_EXECUTE_WRITECOPY | \
124  PAGE_NOACCESS | \
125  PAGE_NOCACHE)
126 
127 #define PAGE_IS_READABLE \
128  (PAGE_READONLY | \
129  PAGE_READWRITE | \
130  PAGE_WRITECOPY | \
131  PAGE_EXECUTE_READ | \
132  PAGE_EXECUTE_READWRITE | \
133  PAGE_EXECUTE_WRITECOPY)
134 
135 #define PAGE_IS_WRITABLE \
136  (PAGE_READWRITE | \
137  PAGE_WRITECOPY | \
138  PAGE_EXECUTE_READWRITE | \
139  PAGE_EXECUTE_WRITECOPY)
140 
141 #define PAGE_IS_EXECUTABLE \
142  (PAGE_EXECUTE | \
143  PAGE_EXECUTE_READ | \
144  PAGE_EXECUTE_READWRITE | \
145  PAGE_EXECUTE_WRITECOPY)
146 
147 #define PAGE_IS_WRITECOPY \
148  (PAGE_WRITECOPY | \
149  PAGE_EXECUTE_WRITECOPY)
150 
151 //
152 // Wait entry for marking pages that are being serviced
153 //
154 #ifdef _M_IX86
155 #define MM_WAIT_ENTRY 0x7ffffc00
156 #elif defined(_M_AMD64)
157 #define MM_WAIT_ENTRY 0x7FFFFFFFFFFFFC00ULL
158 #else
159 #error Unsupported architecture!
160 #endif
161 
162 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
163  InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
164 
165 #define InterlockedExchangePte(PointerPte, Value) \
166  InterlockedExchange((PLONG)(PointerPte), Value)
167 
168 typedef struct _MM_SECTION_SEGMENT
169 {
171 
172  FAST_MUTEX Lock; /* lock which protects the page directory */
173  LARGE_INTEGER RawLength; /* length of the segment which is part of the mapped file */
174  LARGE_INTEGER Length; /* absolute length of the segment */
181 
182  struct
183  {
184  ULONGLONG FileOffset; /* start offset into the file for image sections */
185  ULONG_PTR VirtualAddress; /* start offset into the address range for image sections */
187  } Image;
188 
191 
193 
196 
198 {
200 
203 
209 
210 #define MM_PHYSICALMEMORY_SEGMENT (0x1)
211 #define MM_DATAFILE_SEGMENT (0x2)
212 #define MM_SEGMENT_INDELETE (0x4)
213 #define MM_SEGMENT_INCREATE (0x8)
214 
215 
216 #define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn << PAGE_SHIFT)
217 #define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 1) << PAGE_SHIFT)
218 
219 typedef struct _MEMORY_AREA
220 {
222 
228 
229  struct
230  {
234  } SectionData;
236 
237 typedef struct _MM_RMAP_ENTRY
238 {
242 #if DBG
243  PVOID Caller;
244 #endif
245 }
247 
248 #if MI_TRACE_PFNS
251 #define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
252 #define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, min(sizeof(x), sizeof(MI_PFN_CURRENT_PROCESS_NAME)))
254 void
256 {
257  if (!Process)
258  MI_SET_PROCESS2("Kernel");
259  else if (Process == (PEPROCESS)1)
260  MI_SET_PROCESS2("Hydra");
261  else
262  MI_SET_PROCESS2(Process->ImageFileName);
263 }
264 
266 void
267 MI_SET_PROCESS_USTR(PUNICODE_STRING ustr)
268 {
269  PWSTR pos, strEnd;
270  int i;
271 
272  if (!ustr->Buffer || ustr->Length == 0)
273  {
275  return;
276  }
277 
278  pos = strEnd = &ustr->Buffer[ustr->Length / sizeof(WCHAR)];
279  while ((*pos != L'\\') && (pos > ustr->Buffer))
280  pos--;
281 
282  if (*pos == L'\\')
283  pos++;
284 
285  for (i = 0; i < sizeof(MI_PFN_CURRENT_PROCESS_NAME) && pos <= strEnd; i++, pos++)
287 }
288 #else
289 #define MI_SET_USAGE(x)
290 #define MI_SET_PROCESS(x)
291 #define MI_SET_PROCESS2(x)
292 #endif
293 
294 typedef enum _MI_PFN_USAGES
295 {
322 } MI_PFN_USAGES;
323 
324 //
325 // These two mappings are actually used by Windows itself, based on the ASSERTS
326 //
327 #define StartOfAllocation ReadInProgress
328 #define EndOfAllocation WriteInProgress
329 
330 typedef struct _MMPFNENTRY
331 {
333  USHORT ReadInProgress:1; // StartOfAllocation
334  USHORT WriteInProgress:1; // EndOfAllocation
342 } MMPFNENTRY;
343 
344 // Mm internal
345 typedef struct _MMPFN
346 {
347  union
348  {
354 
355  // HACK for ROSPFN
357  } u1;
359  union
360  {
363  } u2;
364  union
365  {
366  struct
367  {
370  };
371  struct
372  {
375  } e2;
376  } u3;
377  union
378  {
381 
382  // HACK for ROSPFN
384  };
385  union
386  {
388  struct
389  {
396  };
397  } u4;
398 #if MI_TRACE_PFNS
399  MI_PFN_USAGES PfnUsage;
400  CHAR ProcessName[16];
401 #define MI_SET_PFN_PROCESS_NAME(pfn, x) memcpy(pfn->ProcessName, x, min(sizeof(x), sizeof(pfn->ProcessName)))
402 #endif
403 
404  // HACK until WS lists are supported
406  struct _MMPFN* NextLRU;
408 } MMPFN, *PMMPFN;
409 
410 extern PMMPFN MmPfnDatabase;
411 
412 typedef struct _MMPFNLIST
413 {
419 
425 
426 typedef struct _MM_MEMORY_CONSUMER
427 {
432 
433 typedef struct _MM_REGION
434 {
440 
441 // Mm internal
442 /* Entry describing free pool memory */
443 typedef struct _MMFREE_POOL_ENTRY
444 {
450 
451 /* Signature of a freed block */
452 #define MM_FREE_POOL_SIGNATURE 'ARM3'
453 
454 /* Paged pool information */
455 typedef struct _MM_PAGED_POOL_INFO
456 {
466 
468 
469 /* Page file information */
470 typedef struct _MMPAGING_FILE
471 {
481 }
483 
485 
486 typedef VOID
490  SIZE_T Length,
491  ULONG OldType,
492  ULONG OldProtect,
493  ULONG NewType,
495 );
496 
497 typedef VOID
499  PVOID Context,
501  PVOID Address,
503  SWAPENTRY SwapEntry,
504  BOOLEAN Dirty
505 );
506 
507 //
508 // Mm copy support for Kd
509 //
510 NTSTATUS
511 NTAPI
514  IN PVOID Buffer,
515  IN ULONG Size,
516  IN ULONG Flags
517 );
518 
519 //
520 // Determines if a given address is a session address
521 //
522 BOOLEAN
523 NTAPI
526 );
527 
528 ULONG
529 NTAPI
532 );
533 
534 ULONG
535 NTAPI
538 );
539 
540 /* marea.c *******************************************************************/
541 
542 NTSTATUS
543 NTAPI
546  ULONG Type,
548  SIZE_T Length,
549  ULONG Protection,
551  ULONG AllocationFlags,
552  ULONG AllocationGranularity
553 );
554 
556 NTAPI
559  PVOID Address
560 );
561 
562 NTSTATUS
563 NTAPI
568  PVOID FreePageContext
569 );
570 
571 VOID
572 NTAPI
575  PMMVAD Vad);
576 
578 NTAPI
581  PVOID Address,
582  SIZE_T Length
583 );
584 
585 PVOID
586 NTAPI
587 MmFindGap(
589  SIZE_T Length,
590  ULONG_PTR Granularity,
591  BOOLEAN TopDown
592 );
593 
594 VOID
595 NTAPI
598 
599 VOID
600 NTAPI
602 
603 /* npool.c *******************************************************************/
604 
605 VOID
606 NTAPI
608 
609 PVOID
610 NTAPI
613  IN SIZE_T SizeInBytes
614 );
615 
616 POOL_TYPE
617 NTAPI
620 );
621 
622 ULONG
623 NTAPI
625  IN PVOID StartingAddress
626 );
627 
628 /* pool.c *******************************************************************/
629 
630 BOOLEAN
631 NTAPI
634  IN ULONG CurrentMaxQuota,
635  OUT PULONG NewMaxQuota
636 );
637 
638 /* mdl.c *********************************************************************/
639 
640 VOID
641 NTAPI
643  PMDL Mdl,
644  PPFN_NUMBER Pages
645 );
646 
647 /* mminit.c ******************************************************************/
648 
649 VOID
650 NTAPI
651 MmInit1(
652  VOID
653 );
654 
655 BOOLEAN
656 NTAPI
657 MmInitSystem(IN ULONG Phase,
658  IN PLOADER_PARAMETER_BLOCK LoaderBlock);
659 
660 
661 /* pagefile.c ****************************************************************/
662 
663 SWAPENTRY
664 NTAPI
666 
667 VOID
668 NTAPI
670 
671 VOID
672 NTAPI
674 
675 BOOLEAN
676 NTAPI
678 
679 NTSTATUS
680 NTAPI
682  SWAPENTRY SwapEntry,
684 );
685 
686 NTSTATUS
687 NTAPI
689  SWAPENTRY SwapEntry,
691 );
692 
693 VOID
694 NTAPI
696 
697 NTSTATUS
698 NTAPI
701  _In_ ULONG PageFileIndex,
702  _In_ ULONG_PTR PageFileOffset);
703 
704 /* process.c ****************************************************************/
705 
706 NTSTATUS
707 NTAPI
710  IN PEPROCESS Clone OPTIONAL,
711  IN PVOID Section OPTIONAL,
712  IN OUT PULONG Flags,
714 );
715 
716 NTSTATUS
717 NTAPI
720  IN PINITIAL_PEB InitialPeb,
721  OUT PPEB *BasePeb
722 );
723 
724 NTSTATUS
725 NTAPI
729  IN PINITIAL_TEB InitialTeb,
730  OUT PTEB* BaseTeb
731 );
732 
733 VOID
734 NTAPI
736  struct _EPROCESS *Process,
737  PTEB Teb
738 );
739 
740 VOID
741 NTAPI
743 
744 NTSTATUS
745 NTAPI
747 
748 ULONG
749 NTAPI
751 
752 NTSTATUS
753 NTAPI
756  IN UCHAR MemoryPriority
757 );
758 
759 /* i386/pfault.c *************************************************************/
760 
761 NTSTATUS
762 NTAPI
764  ULONG Cs,
765  PULONG Eip,
766  PULONG Eax,
767  ULONG Cr2,
769 );
770 
771 /* special.c *****************************************************************/
772 
773 VOID
774 NTAPI
776 
777 BOOLEAN
778 NTAPI
781  IN ULONG Tag);
782 
783 BOOLEAN
784 NTAPI
786  IN PVOID P);
787 
788 BOOLEAN
789 NTAPI
791  IN PVOID P);
792 
793 PVOID
794 NTAPI
797  IN ULONG Tag,
799  IN ULONG SpecialType);
800 
801 VOID
802 NTAPI
804  IN PVOID P);
805 
806 /* mm.c **********************************************************************/
807 
808 NTSTATUS
809 NTAPI
811  IN ULONG FaultCode,
812  IN PVOID Address,
814  IN PVOID TrapInformation
815 );
816 
817 /* process.c *****************************************************************/
818 
819 PVOID
820 NTAPI
822 
823 VOID
824 NTAPI
826  BOOLEAN GuiStack);
827 
828 /* balance.c *****************************************************************/
829 
830 VOID
831 NTAPI
833  ULONG Consumer,
834  NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
835 );
836 
837 VOID
838 NTAPI
840  ULONG NrAvailablePages,
841  ULONG NrSystemPages
842 );
843 
844 NTSTATUS
845 NTAPI
847  ULONG Consumer,
849 );
850 
851 NTSTATUS
852 NTAPI
854  ULONG Consumer,
855  BOOLEAN MyWait,
856  PPFN_NUMBER AllocatedPage
857 );
858 
859 VOID
860 NTAPI
862 
863 VOID
864 NTAPI
866 
867 /* rmap.c **************************************************************/
868 #define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff)
869 #define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
870 
871 VOID
872 NTAPI
875  struct _MM_RMAP_ENTRY* ListHead
876 );
877 
878 struct _MM_RMAP_ENTRY*
879 NTAPI
881 
882 VOID
883 NTAPI
886  struct _EPROCESS *Process,
887  PVOID Address
888 );
889 
890 VOID
891 NTAPI
894  PVOID Context,
895  VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
896 );
897 
898 VOID
899 NTAPI
902  struct _EPROCESS *Process,
903  PVOID Address
904 );
905 
906 VOID
907 NTAPI
909 
910 NTSTATUS
911 NTAPI
913 
915 NTAPI
918 
919 /* freelist.c **********************************************************/
920 
922 KIRQL
924 {
926 }
927 
929 VOID
932 {
934 }
935 
937 VOID
939 {
940  PKSPIN_LOCK_QUEUE LockQueue;
941 
943  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
945 }
946 
948 VOID
950 {
951  PKSPIN_LOCK_QUEUE LockQueue;
952 
953  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
956 }
957 
958 #define MI_ASSERT_PFN_LOCK_HELD() ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL)
959 
961 PMMPFN
963 {
964  PMMPFN Page;
965  extern RTL_BITMAP MiPfnBitMap;
966 
967  /* Make sure the PFN number is valid */
968  if (Pfn > MmHighestPhysicalPage) return NULL;
969 
970  /* Make sure this page actually has a PFN entry */
971  if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL;
972 
973  /* Get the entry */
974  Page = &MmPfnDatabase[Pfn];
975 
976  /* Return it */
977  return Page;
978 };
979 
983 {
984  //
985  // This will return the Page Frame Number (PFN) from the MMPFN
986  //
987  return Pfn1 - MmPfnDatabase;
988 }
989 
991 NTAPI
992 MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast);
993 
995 NTAPI
997 
998 VOID
999 NTAPI
1001  IN BOOLEAN StatusOnly
1002 );
1003 
1004 VOID
1005 NTAPI
1007  VOID
1008 );
1009 
1010 /* hypermap.c *****************************************************************/
1011 PVOID
1012 NTAPI
1014  IN PFN_NUMBER Page,
1015  IN PKIRQL OldIrql);
1016 
1017 VOID
1018 NTAPI
1020  IN PVOID Address,
1021  IN KIRQL OldIrql);
1022 
1023 PVOID
1024 NTAPI
1026  IN PFN_NUMBER NumberOfPages);
1027 
1028 VOID
1029 NTAPI
1031  IN PFN_NUMBER NumberOfPages);
1032 
1033 /* i386/page.c *********************************************************/
1034 
1035 NTSTATUS
1036 NTAPI
1038  struct _EPROCESS* Process,
1039  PVOID Address,
1040  ULONG flProtect,
1042 );
1043 
1044 NTSTATUS
1045 NTAPI
1047  struct _EPROCESS* Process,
1048  PVOID Address,
1049  ULONG flProtect,
1051 );
1052 
1053 ULONG
1054 NTAPI
1056  struct _EPROCESS* Process,
1057  PVOID Address);
1058 
1059 VOID
1060 NTAPI
1062  struct _EPROCESS* Process,
1063  PVOID Address,
1064  ULONG flProtect
1065 );
1066 
1067 BOOLEAN
1068 NTAPI
1070  struct _EPROCESS* Process,
1071  PVOID Address
1072 );
1073 
1074 BOOLEAN
1075 NTAPI
1077  struct _EPROCESS* Process,
1078  PVOID Address
1079 );
1080 
1081 VOID
1082 NTAPI
1084 
1085 VOID
1086 NTAPI
1088  struct _EPROCESS *Process,
1089  PVOID Address,
1090  SWAPENTRY* SwapEntry
1091 );
1092 
1093 NTSTATUS
1094 NTAPI
1096  struct _EPROCESS *Process,
1097  PVOID Address,
1098  SWAPENTRY SwapEntry
1099 );
1100 
1101 VOID
1102 NTAPI
1105  PVOID Address,
1106  SWAPENTRY *SwapEntry);
1107 
1108 BOOLEAN
1109 NTAPI
1111  struct _EPROCESS *Process,
1112  PVOID Address
1113 );
1114 
1115 PFN_NUMBER
1116 NTAPI
1117 MmAllocPage(
1118  ULONG Consumer
1119 );
1120 
1121 VOID
1122 NTAPI
1124 
1125 VOID
1126 NTAPI
1128 
1129 ULONG
1130 NTAPI
1132 
1133 BOOLEAN
1134 NTAPI
1136 
1137 VOID
1138 NTAPI
1140  PFN_NUMBER Page,
1141  SWAPENTRY SavedSwapEntry);
1142 
1143 SWAPENTRY
1144 NTAPI
1146 
1147 VOID
1148 NTAPI
1150  struct _EPROCESS *Process,
1151  PVOID Address
1152 );
1153 
1154 VOID
1155 NTAPI
1157 #define MmSetCleanPage(__P, __A) MmSetDirtyBit(__P, __A, FALSE)
1158 #define MmSetDirtyPage(__P, __A) MmSetDirtyBit(__P, __A, TRUE)
1159 
1160 VOID
1161 NTAPI
1163  struct _EPROCESS *Process,
1164  PVOID Address
1165 );
1166 
1167 PFN_NUMBER
1168 NTAPI
1170  struct _EPROCESS *Process,
1171  PVOID Address
1172 );
1173 
1174 BOOLEAN
1175 NTAPI
1177  IN ULONG MinWs,
1178  IN PEPROCESS Dest,
1179  IN PULONG_PTR DirectoryTableBase
1180 );
1181 
1182 NTSTATUS
1183 NTAPI
1186  IN PULONG_PTR DirectoryTableBase
1187 );
1188 
1189 NTSTATUS
1190 NTAPI
1193 );
1194 
1195 NTSTATUS
1196 NTAPI
1197 MmSetExecuteOptions(IN ULONG ExecuteOptions);
1198 
1199 NTSTATUS
1200 NTAPI
1201 MmGetExecuteOptions(IN PULONG ExecuteOptions);
1202 
1203 VOID
1204 NTAPI
1206  struct _EPROCESS *Process,
1207  PVOID Address,
1208  BOOLEAN* WasDirty,
1210 );
1211 
1212 /* arch/procsup.c ************************************************************/
1213 
1214 BOOLEAN
1217  _In_ PULONG_PTR DirectoryTableBase);
1218 
1219 /* wset.c ********************************************************************/
1220 
1221 NTSTATUS
1223  ULONG Target,
1224  ULONG Priority,
1225  PULONG NrFreedPages
1226 );
1227 
1228 /* region.c ************************************************************/
1229 
1230 NTSTATUS
1231 NTAPI
1235  PLIST_ENTRY RegionListHead,
1236  PVOID StartAddress,
1237  SIZE_T Length,
1238  ULONG NewType,
1239  ULONG NewProtect,
1240  PMM_ALTER_REGION_FUNC AlterFunc
1241 );
1242 
1243 VOID
1244 NTAPI
1246  PLIST_ENTRY RegionListHead,
1247  SIZE_T Length,
1248  ULONG Type,
1249  ULONG Protect
1250 );
1251 
1252 PMM_REGION
1253 NTAPI
1254 MmFindRegion(
1256  PLIST_ENTRY RegionListHead,
1257  PVOID Address,
1258  PVOID* RegionBaseAddress
1259 );
1260 
1261 /* section.c *****************************************************************/
1262 
1263 #define PFN_FROM_SSE(E) ((PFN_NUMBER)((E) >> PAGE_SHIFT))
1264 #define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
1265 #define MM_IS_WAIT_PTE(E) \
1266  (IS_SWAP_FROM_SSE(E) && SWAPENTRY_FROM_SSE(E) == MM_WAIT_ENTRY)
1267 #define MAKE_PFN_SSE(P) ((ULONG_PTR)((P) << PAGE_SHIFT))
1268 #define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
1269 #define MAKE_SWAP_SSE(S) (((ULONG_PTR)(S) << 1) | 0x1)
1270 #define DIRTY_SSE(E) ((E) | 2)
1271 #define CLEAN_SSE(E) ((E) & ~2)
1272 #define IS_DIRTY_SSE(E) ((E) & 2)
1273 #define WRITE_SSE(E) ((E) | 4)
1274 #define IS_WRITE_SSE(E) ((E) & 4)
1275 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
1276 #define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
1277 #define MAX_SHARE_COUNT 0x1FF
1278 #define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
1279 #define BUMPREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) + 1) << 3) | ((E) & 0x7))
1280 #define DECREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) - 1) << 3) | ((E) & 0x7))
1281 
1282 VOID
1283 NTAPI
1285  const char *file,
1286  int line);
1287 
1288 #define MmLockSectionSegment(x) _MmLockSectionSegment(x,__FILE__,__LINE__)
1289 
1290 VOID
1291 NTAPI
1293  const char *file,
1294  int line);
1295 
1296 #define MmUnlockSectionSegment(x) _MmUnlockSectionSegment(x,__FILE__,__LINE__)
1297 
1298 VOID
1299 NTAPI
1301  OUT PSECTION_IMAGE_INFORMATION ImageInformation
1302 );
1303 
1305 NTAPI
1307  IN PVOID Section
1308 );
1309 NTSTATUS
1310 NTAPI
1312  IN PVOID Address,
1314 );
1315 
1316 NTSTATUS
1317 NTAPI
1319  IN PVOID Section,
1321 );
1322 
1323 NTSTATUS
1324 NTAPI
1327  PVOID Address,
1330 );
1331 
1332 NTSTATUS
1333 NTAPI
1338  SIZE_T Length,
1339  ULONG Protect,
1340  PULONG OldProtect
1341 );
1342 
1343 NTSTATUS
1344 NTAPI
1346 
1347 NTSTATUS
1348 NTAPI
1352  PVOID Address,
1353  BOOLEAN Locked
1354 );
1355 
1356 NTSTATUS
1357 NTAPI
1359 
1360 NTSTATUS
1361 NTAPI
1365  PVOID Address,
1366  BOOLEAN Locked
1367 );
1368 
1369 VOID
1370 NTAPI
1372 
1373 /* Exported from NT 6.2 Onward. We keep it internal. */
1374 NTSTATUS
1375 NTAPI
1377  _In_ PVOID Section,
1382  );
1383 
1384 BOOLEAN
1385 NTAPI
1389  _In_ ULONG Length);
1390 
1391 NTSTATUS
1392 NTAPI
1395  _In_ PVOID Address,
1396  _In_ ULONG Length);
1397 
1398 NTSTATUS
1399 NTAPI
1403  _In_ ULONG Length,
1405 
1406 NTSTATUS
1407 NTAPI
1411  _In_ ULONG Length,
1412  _In_ PLARGE_INTEGER ValidDataLength);
1413 
1414 BOOLEAN
1415 NTAPI
1419  _In_ ULONG Length);
1420 
1421 BOOLEAN
1422 NTAPI
1427  BOOLEAN PageOut);
1428 
1429 BOOLEAN
1430 NTAPI
1434  BOOLEAN Dirty,
1435  BOOLEAN PageOut,
1436  ULONG_PTR *InEntry);
1437 
1438 VOID
1439 NTAPI
1441 
1442 NTSTATUS
1443 NTAPI
1445  _In_ PVOID Section,
1447 
1448 /* sptab.c *******************************************************************/
1449 
1450 NTSTATUS
1451 NTAPI
1454  ULONG_PTR Entry,
1455  const char *file,
1456  int line);
1457 
1458 ULONG_PTR
1459 NTAPI
1462  const char *file,
1463  int line);
1464 
1465 #define MmSetPageEntrySectionSegment(S,O,E) _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__)
1466 
1467 #define MmGetPageEntrySectionSegment(S,O) _MmGetPageEntrySectionSegment(S,O,__FILE__,__LINE__)
1468 
1469 /* sysldr.c ******************************************************************/
1470 
1471 VOID
1472 NTAPI
1474  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1475 );
1476 
1477 BOOLEAN
1478 NTAPI
1480  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1481 );
1482 
1483 BOOLEAN
1484 NTAPI
1486 
1487 VOID
1488 NTAPI
1490 
1491 NTSTATUS
1492 NTAPI
1495  IN PUNICODE_STRING NamePrefix OPTIONAL,
1496  IN PUNICODE_STRING LoadedName OPTIONAL,
1497  IN ULONG Flags,
1498  OUT PVOID *ModuleObject,
1499  OUT PVOID *ImageBaseAddress
1500 );
1501 
1502 NTSTATUS
1503 NTAPI
1505  IN PVOID ImageHandle
1506 );
1507 
1508 NTSTATUS
1509 NTAPI
1511  IN HANDLE ImageHandle,
1512  IN BOOLEAN PurgeSection
1513 );
1514 
1515 NTSTATUS
1516 NTAPI
1518  IN PLDR_DATA_TABLE_ENTRY LdrEntry,
1519  IN PLIST_ENTRY ListHead
1520 );
1521 
1522 VOID
1523 NTAPI
1525  IN PLDR_DATA_TABLE_ENTRY LdrEntry);
1526 
1527 /* procsup.c *****************************************************************/
1528 
1529 NTSTATUS
1530 NTAPI
1532  IN PVOID StackPointer
1533 );
1534 
1535 
1537 VOID
1539 {
1540  KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1541 }
1542 
1544 VOID
1546 {
1547  KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1548 }
1549 
1551 PEPROCESS
1553 {
1554  if (AddressSpace == MmKernelAddressSpace) return NULL;
1556 }
1557 
1559 PMMSUPPORT
1561 {
1562  return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->Vm;
1563 }
1564 
1566 PMMSUPPORT
1568 {
1569  return MmKernelAddressSpace;
1570 }
1571 
1572 
1573 /* expool.c ******************************************************************/
1574 
1575 VOID
1576 NTAPI
1578  PVOID P,
1580  ULONG Tag);
1581 
1582 VOID
1583 NTAPI
1585  IN PVOID P);
1586 
1587 
1588 /* mmsup.c *****************************************************************/
1589 
1590 NTSTATUS
1591 NTAPI
1593  IN SIZE_T WorkingSetMinimumInBytes,
1594  IN SIZE_T WorkingSetMaximumInBytes,
1595  IN ULONG SystemCache,
1596  IN BOOLEAN IncreaseOkay);
1597 
1598 
1599 /* session.c *****************************************************************/
1600 
1602 NTSTATUS
1603 NTAPI
1604 MmAttachSession(
1605  _Inout_ PVOID SessionEntry,
1607 
1609 VOID
1610 NTAPI
1611 MmDetachSession(
1612  _Inout_ PVOID SessionEntry,
1614 
1615 VOID
1616 NTAPI
1618  _Inout_ PVOID SessionEntry);
1619 
1620 PVOID
1621 NTAPI
1623  _In_ ULONG SessionId);
1624 
1626 VOID
1627 NTAPI
1628 MmSetSessionLocaleId(
1629  _In_ LCID LocaleId);
1630 
1631 /* shutdown.c *****************************************************************/
1632 
1633 VOID
1634 MmShutdownSystem(IN ULONG Phase);
1635 
1636 /* virtual.c *****************************************************************/
1637 
1638 NTSTATUS
1639 NTAPI
1640 MmCopyVirtualMemory(IN PEPROCESS SourceProcess,
1642  IN PEPROCESS TargetProcess,
1646  OUT PSIZE_T ReturnSize);
1647 
1648 /* wslist.cpp ****************************************************************/
1649 _Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex)
1650 VOID
1651 NTAPI
1652 MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet);
1653 
1654 #ifdef __cplusplus
1655 } // extern "C"
1656 #endif
VOID NTAPI MmDereferencePage(PFN_NUMBER Page)
Definition: freelist.c:566
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
NTSTATUS NTAPI MmExtendSection(_In_ PVOID Section, _Inout_ PLARGE_INTEGER NewSize)
Definition: section.c:4956
VOID FASTCALL KeReleaseQueuedSpinLockFromDpcLevel(IN OUT PKSPIN_LOCK_QUEUE LockQueue)
PRTL_BITMAP PagedPoolAllocationMap
Definition: mm.h:457
PULONG Buffer
Definition: typedefs.h:91
ULONG_PTR VirtualAddress
Definition: mm.h:185
PMM_REGION NTAPI MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, PVOID *RegionBaseAddress)
Definition: region.c:257
NTSTATUS NTAPI MmCreateTeb(IN PEPROCESS Process, IN PCLIENT_ID ClientId, IN PINITIAL_TEB InitialTeb, OUT PTEB *BaseTeb)
Definition: procsup.c:740
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1734
BOOLEAN WriteCopy
Definition: mm.h:179
PFN_NUMBER MmResidentAvailablePages
Definition: freelist.c:27
#define IN
Definition: typedefs.h:39
NTSTATUS NTAPI MmCopyVirtualMemory(IN PEPROCESS SourceProcess, IN PVOID SourceAddress, IN PEPROCESS TargetProcess, OUT PVOID TargetAddress, IN SIZE_T BufferSize, IN KPROCESSOR_MODE PreviousMode, OUT PSIZE_T ReturnSize)
Definition: virtual.c:1282
VOID NTAPI MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: sysldr.c:1635
PEPROCESS Process
Definition: mm.h:240
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]
Definition: balance.c:29
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
SIZE_T MmtotalCommitLimitMaximum
Definition: freelist.c:36
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID(* PMM_ALTER_REGION_FUNC)(PMMSUPPORT AddressSpace, PVOID BaseAddress, SIZE_T Length, ULONG OldType, ULONG OldProtect, ULONG NewType, ULONG NewProtect)
Definition: mm.h:487
VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject)
ULONG Type
Definition: mm.h:223
ULONG MI_PFN_CURRENT_USAGE
Definition: pfnlist.c:63
struct _MEMORY_AREA * PMEMORY_AREA
_In_ ULONG Mode
Definition: hubbusif.h:303
ULONG Characteristics
Definition: mm.h:186
Definition: ntbasedef.h:628
NTSTATUS NTAPI MmAccessFault(IN ULONG FaultCode, IN PVOID Address, IN KPROCESSOR_MODE Mode, IN PVOID TrapInformation)
Definition: mmfault.c:205
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:42
VOID NTAPI MmInit1(VOID)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T _In_ SECTION_INHERIT _In_ ULONG _In_ ULONG Protect
Definition: zwfuncs.h:214
NTSTATUS NTAPI MmGetFileNameForSection(IN PVOID Section, OUT POBJECT_NAME_INFORMATION *ModuleName)
Definition: section.c:1861
ULONG PFN_COUNT
Definition: mmtypes.h:102
ULONG NTAPI MmGetPageProtect(struct _EPROCESS *Process, PVOID Address)
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Page)
Definition: freelist.c:559
USHORT ReadInProgress
Definition: mm.h:333
struct _MM_RMAP_ENTRY *NTAPI MmGetRmapListHeadPage(PFN_NUMBER Page)
Definition: freelist.c:458
NTSTATUS NTAPI MmMakeDataSectionResident(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ LONGLONG Offset, _In_ ULONG Length, _In_ PLARGE_INTEGER ValidDataLength)
Definition: section.c:4641
uint16_t * PWSTR
Definition: typedefs.h:56
VOID NTAPI MmDumpArmPfnDatabase(IN BOOLEAN StatusOnly)
Definition: mminit.c:1474
BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: sysldr.c:2204
ULONG_PTR AweAllocation
Definition: mm.h:393
ULONG Signature
Definition: mm.h:447
ULONG PagesTarget
Definition: mm.h:429
struct _MM_SECTION_SEGMENT::@1774 Image
struct _MMPFN::@1778::@1784 e2
VOID NTAPI MmDeleteRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
BOOLEAN MiArchCreateProcessAddressSpace(_In_ PEPROCESS Process, _In_ PULONG_PTR DirectoryTableBase)
Definition: procsup.c:21
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
VOID NTAPI MmDeleteKernelStack(PVOID Stack, BOOLEAN GuiStack)
VOID MmShutdownSystem(IN ULONG Phase)
Definition: shutdown.c:77
MMLISTS ListName
Definition: mm.h:415
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1545
VOID NTAPI MmBuildMdlFromPages(PMDL Mdl, PPFN_NUMBER Pages)
Definition: pagefile.c:94
ULONG SessionId
Definition: dllmain.c:28
BOOLEAN NTAPI MmArePagesResident(_In_ PEPROCESS Process, _In_ PVOID BaseAddress, _In_ ULONG Length)
Definition: section.c:4496
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion(PMMSUPPORT AddressSpace, PVOID Address, SIZE_T Length)
Definition: marea.c:106
PMM_RMAP_ENTRY RmapListHead
Definition: mm.h:383
struct _MM_PAGED_POOL_INFO MM_PAGED_POOL_INFO
NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID)
Definition: section.c:2148
Definition: mm.h:433
ULONG SectionCount
Definition: mm.h:176
struct _MM_RMAP_ENTRY MM_RMAP_ENTRY
LONG NTSTATUS
Definition: precomp.h:26
PFN_NUMBER Size
Definition: mm.h:472
NTSTATUS NTAPI MiReadPageFile(_In_ PFN_NUMBER Page, _In_ ULONG PageFileIndex, _In_ ULONG_PTR PageFileOffset)
Definition: pagefile.c:194
PVOID NTAPI MmGetSessionById(_In_ ULONG SessionId)
Definition: session.c:1053
BOOLEAN NTAPI MmIsSessionAddress(IN PVOID Address)
Definition: session.c:48
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1079
PFN_NUMBER Flink
Definition: mm.h:349
struct _EPROCESS * PEPROCESS
Definition: nt_native.h:30
LIST_ENTRY RegionListHead
Definition: mm.h:233
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
Definition: balance.c:77
SIZE_T MmSharedCommit
Definition: freelist.c:31
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:275
FORCEINLINE KIRQL MiAcquirePfnLock(VOID)
Definition: mm.h:923
VOID(* PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
Definition: mm.h:498
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
USHORT Modified
Definition: mm.h:332
PMM_SECTION_SEGMENT Segment
Definition: mm.h:232
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
NTSTATUS NTAPI MmCreatePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY SwapEntry)
VOID NTAPI MiCheckAllProcessMemoryAreas(VOID)
NTSTATUS NTAPI _MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, ULONG_PTR Entry, const char *file, int line)
Definition: sptab.c:178
BOOLEAN NTAPI MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN Dirty, BOOLEAN PageOut, ULONG_PTR *InEntry)
Definition: section.c:1084
struct _MMPFNENTRY MMPFNENTRY
VOID FASTCALL KeAcquireQueuedSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK_QUEUE LockQueue)
PVOID MmTriageActionTaken
Definition: drvmgmt.c:27
USHORT RemovalRequested
Definition: mm.h:338
PVOID MmUnloadedDrivers
Definition: sysldr.c:43
BOOLEAN NTAPI MmPurgeSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length)
Definition: section.c:4549
DWORD LCID
Definition: nls.h:13
PFILE_OBJECT FileObject
Definition: mm.h:477
PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation(PFN_NUMBER Page, PLARGE_INTEGER Offset)
Definition: sptab.c:352
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1274
NTSTATUS NTAPI MmGetFileNameForAddress(IN PVOID Address, OUT PUNICODE_STRING ModuleName)
Definition: section.c:1882
VOID NTAPI MmDeletePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
NTSTATUS NTAPI MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
Definition: pagefile.c:187
BOOLEAN NTAPI MmCheckDirtySegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN ForceDirty, BOOLEAN PageOut)
NTSTATUS NTAPI MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes, IN SIZE_T WorkingSetMaximumInBytes, IN ULONG SystemCache, IN BOOLEAN IncreaseOkay)
Definition: mmsup.c:44
PFN_NUMBER MmAvailablePages
Definition: freelist.c:26
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
Definition: marea.c:60
MMPFNLIST MmZeroedPageListHead
Definition: pfnlist.c:41
KMUTANT MmSystemLoadLock
Definition: sysldr.c:39
VOID NTAPI MmDeleteTeb(struct _EPROCESS *Process, PTEB Teb)
VOID NTAPI MiRosCleanupMemoryArea(PEPROCESS Process, PMMVAD Vad)
Definition: marea.c:512
union _MMPFN::@1781 u4
USHORT ReferenceCount
Definition: mm.h:368
PVOID NTAPI MmAllocateSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag, IN POOL_TYPE PoolType, IN ULONG SpecialType)
MMPFNLIST MmStandbyPageListHead
Definition: pfnlist.c:43
FORCEINLINE VOID MiReleasePfnLock(_In_ KIRQL OldIrql)
Definition: mm.h:930
union _MMPFN::@1778 u3
USHORT PageLocation
Definition: mm.h:337
PMMPFN MmPfnDatabase
Definition: freelist.c:24
#define _In_opt_
Definition: no_sal2.h:212
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1368
struct _MM_IMAGE_SECTION_OBJECT MM_IMAGE_SECTION_OBJECT
PFN_NUMBER Flink
Definition: mm.h:416
enum _MMLISTS MMLISTS
FORCEINLINE VOID MiReleasePfnLockFromDpcLevel(VOID)
Definition: mm.h:949
MMPFNLIST MmModifiedNoWritePageListHead
Definition: pfnlist.c:47
PVOID NTAPI MmFindGap(PMMSUPPORT AddressSpace, SIZE_T Length, ULONG_PTR Granularity, BOOLEAN TopDown)
Definition: marea.c:215
uint32_t ULONG_PTR
Definition: typedefs.h:65
VOID NTAPI MmMakeKernelResourceSectionWritable(VOID)
Definition: sysldr.c:2324
FORCEINLINE VOID MiAcquirePfnLockAtDpcLevel(VOID)
Definition: mm.h:938
MMWSLE Wsle
Definition: mm.h:405
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
USHORT PrototypePte
Definition: mm.h:335
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
UCHAR KIRQL
Definition: env_spec_w32.h:591
MMPFNENTRY e1
Definition: mm.h:369
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG Magic
Definition: mm.h:226
NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, PSIZE_T ResultLength)
Definition: section.c:2051
BOOLEAN NTAPI MmIsPagePresent(struct _EPROCESS *Process, PVOID Address)
VOID NTAPI MmInitializeMemoryConsumer(ULONG Consumer, NTSTATUS(*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed))
Definition: balance.c:62
VOID NTAPI MmInitPagingFile(VOID)
Definition: pagefile.c:255
USHORT CacheAttribute
Definition: mm.h:339
PLARGE_INTEGER BOOLEAN ForceDirty
Definition: section.c:4750
#define MC_MAXIMUM
Definition: mm.h:98
VOID NTAPI MmZeroPageThread(VOID)
Definition: zeropage.c:36
union _MMPFN::@1776 u1
RTL_BITMAP MiPfnBitMap
Definition: init.c:44
ULONG PFN_NUMBER
Definition: ke.h:9
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
Definition: freelist.c:125
NTSTATUS NTAPI MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, SIZE_T Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
Definition: region.c:108
VOID NTAPI MmGetImageInformation(OUT PSECTION_IMAGE_INFORMATION ImageInformation)
Definition: section.c:1808
ULONG_PTR MustBeCached
Definition: mm.h:395
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS NTAPI MmInitSectionImplementation(VOID)
Definition: section.c:2239
PMMPTE LastPteForPagedPool
Definition: mm.h:460
ULONG Type
Definition: mm.h:435
struct _MM_MEMORY_CONSUMER * PMM_MEMORY_CONSUMER
#define MI_SET_PROCESS(x)
Definition: mm.h:290
struct _MMPFNLIST * PMMPFNLIST
ULONG_PTR ShareCount
Definition: mm.h:362
SIZE_T MmTotalCommitLimit
Definition: mminit.c:359
NTSTATUS NTAPI MmCallDllInitialize(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN PLIST_ENTRY ListHead)
Definition: sysldr.c:308
ULONG Protection
Definition: mm.h:177
VOID NTAPI MmRebalanceMemoryConsumers(VOID)
Definition: balance.c:265
long LONG
Definition: pedump.c:60
USHORT ParityError
Definition: mm.h:341
ULONG NTAPI MmGetSessionLocaleId(VOID)
Definition: session.c:56
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:207
PFN_NUMBER Blink
Definition: mm.h:417
PKEVENT Event
Definition: mm.h:351
#define MI_SET_PROCESS2(x)
Definition: mm.h:291
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2293
PMMSUPPORT MmKernelAddressSpace
Definition: mminit.c:27
struct _MM_RMAP_ENTRY * PMM_RMAP_ENTRY
LIST_ENTRY List
Definition: mm.h:445
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER _Outptr_ PVOID * TargetAddress
Definition: iotypes.h:1035
struct _MMPAGING_FILE * PMMPAGING_FILE
PVOID NTAPI MiMapPageInHyperSpace(IN PEPROCESS Process, IN PFN_NUMBER Page, IN PKIRQL OldIrql)
Definition: hypermap.c:28
NTSTATUS NTAPI MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1877
NTSTATUS NTAPI MmGetExecuteOptions(IN PULONG ExecuteOptions)
Definition: pagfault.c:2531
BOOLEAN Locked
Definition: mm.h:180
unsigned char BOOLEAN
SIZE_T AllocatedPagedPool
Definition: mm.h:464
SIZE_T MmPeakCommitment
Definition: freelist.c:35
static WCHAR Address[46]
Definition: ping.c:68
NTSTATUS NTAPI MmCreateVirtualMappingUnsafe(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
VOID NTAPI MmDeleteVirtualMapping(struct _EPROCESS *Process, PVOID Address, BOOLEAN *WasDirty, PPFN_NUMBER Page)
ULONG_PTR VerifierAllocation
Definition: mm.h:392
SIZE_T Length
Definition: mm.h:437
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
#define _Out_
Definition: no_sal2.h:160
Definition: parser.c:48
NTSTATUS NTAPI MmPageOutPhysicalAddress(PFN_NUMBER Page)
Definition: rmap.c:51
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4756
VOID NTAPI _MmLockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line)
Definition: data.c:98
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
struct _MMPFN * PreviousLRU
Definition: mm.h:407
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
VOID NTAPI MmQuitNextSession(_Inout_ PVOID SessionEntry)
Definition: session.c:1033
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
Definition: procsup.c:459
SIZE_T PagedPoolCommit
Definition: mm.h:463
PFN_NUMBER MaximumSize
Definition: mm.h:473
PFN_NUMBER MinimumSize
Definition: mm.h:474
VOID NTAPI MmSetRmapListHeadPage(PFN_NUMBER Page, struct _MM_RMAP_ENTRY *ListHead)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
PFILE_OBJECT FileObject
Definition: mm.h:170
UNICODE_STRING PageFileName
Definition: mm.h:478
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
Definition: mmfuncs.h:404
struct _MM_IMAGE_SECTION_OBJECT * PMM_IMAGE_SECTION_OBJECT
_IRQL_requires_max_(APC_LEVEL) NTSTATUS NTAPI MmAttachSession(_Inout_ PVOID SessionEntry
Definition: cddata.c:197
ULONG Protect
Definition: mm.h:436
USHORT WriteInProgress
Definition: mm.h:334
NTSTATUS NTAPI MmCheckSystemImage(IN HANDLE ImageHandle, IN BOOLEAN PurgeSection)
Definition: sysldr.c:2707
NTSTATUS NTAPI MmUnloadSystemImage(IN PVOID ImageHandle)
Definition: sysldr.c:911
NTSTATUS NTAPI MmPageFault(ULONG Cs, PULONG Eip, PULONG Eax, ULONG Cr2, ULONG ErrorCode)
LARGE_INTEGER Length
Definition: mm.h:174
PMMPTE MmDebugPte
Definition: mmdbg.c:31
ULONGLONG FileOffset
Definition: mm.h:184
FAST_MUTEX
Definition: extypes.h:17
BOOLEAN NTAPI MmIsSpecialPoolAddressFree(IN PVOID P)
PFN_COUNT Size
Definition: mm.h:446
int64_t LONGLONG
Definition: typedefs.h:68
VOID NTAPI MmCleanProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1245
int64_t LONG64
Definition: typedefs.h:68
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
VOID NTAPI MiInitializeSpecialPool(VOID)
Definition: special.c:123
_MI_PFN_USAGES
Definition: mm.h:294
LONG64 RefCount
Definition: mm.h:189
POOL_TYPE NTAPI MmDeterminePoolType(IN PVOID VirtualAddress)
Definition: pool.c:406
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
#define ASSERT(a)
Definition: mode.c:45
PFN_NUMBER FreeSpace
Definition: mm.h:475
struct _MMPFNLIST MMPFNLIST
#define MAX_PAGING_FILES
Definition: mm.h:107
__wchar_t WCHAR
Definition: xmlstorage.h:180
return Iosb
Definition: create.c:4402
NTSTATUS NTAPI MmCreatePeb(IN PEPROCESS Process, IN PINITIAL_PEB InitialPeb, OUT PPEB *BasePeb)
Definition: procsup.c:500
Definition: mm.h:443
INT POOL_TYPE
Definition: typedefs.h:78
SWAPENTRY NTAPI MmAllocSwapPage(VOID)
Definition: pagefile.c:304
uint64_t ULONGLONG
Definition: typedefs.h:67
PVOID MiDebugMapping
Definition: mmdbg.c:30
BOOLEAN NTAPI MmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: mminit.c:202
NTSTATUS(* Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
Definition: mm.h:430
NTSTATUS NTAPI MmInitializeProcessAddressSpace(IN PEPROCESS Process, IN PEPROCESS Clone OPTIONAL, IN PVOID Section OPTIONAL, IN OUT PULONG Flags, IN POBJECT_NAME_INFORMATION *AuditName OPTIONAL)
PMM_SECTION_SEGMENT Segments
Definition: mm.h:207
PLARGE_INTEGER BOOLEAN BOOLEAN PageOut
Definition: section.c:4753
struct _MMPAGING_FILE MMPAGING_FILE
BOOLEAN DeleteInProgress
Definition: mm.h:225
BOOLEAN NTAPI MmIsDisabledPage(struct _EPROCESS *Process, PVOID Address)
LARGE_INTEGER RawLength
Definition: mm.h:173
NTSTATUS NTAPI MmFreeMemoryArea(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext)
Definition: marea.c:283
PVOID KernelVerifier
Definition: drvmgmt.c:28
Type
Definition: Type.h:6
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
Definition: spinlock.c:154
PFN_NUMBER MmLowestPhysicalPage
Definition: meminit.c:30
VOID NTAPI ExReturnPoolQuota(IN PVOID P)
Definition: expool.c:1849
VOID NTAPI MmSetPageProtect(struct _EPROCESS *Process, PVOID Address, ULONG flProtect)
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlTestBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:434
MMPFNLIST MmModifiedPageListHead
Definition: pfnlist.c:45
#define _Inout_
Definition: no_sal2.h:162
PFN_NUMBER NTAPI MmAllocPage(ULONG Consumer)
Definition: freelist.c:605
VOID NTAPI MiRosCheckMemoryAreas(PMMSUPPORT AddressSpace)
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
BOOLEAN NTAPI MmIsPageSwapEntry(struct _EPROCESS *Process, PVOID Address)
* PFILE_OBJECT
Definition: iotypes.h:1998
struct _MEMORY_AREA MEMORY_AREA
#define _Outptr_result_bytebuffer_(s)
Definition: no_sal2.h:288
NTSTATUS NTAPI MmCreateMemoryArea(PMMSUPPORT AddressSpace, ULONG Type, PVOID *BaseAddress, SIZE_T Length, ULONG Protection, PMEMORY_AREA *Result, ULONG AllocationFlags, ULONG AllocationGranularity)
Definition: marea.c:401
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Page)
Definition: freelist.c:538
struct _MM_SECTION_SEGMENT * PMM_SECTION_SEGMENT
MMVAD VadNode
Definition: mm.h:221
LIST_ENTRY MmLoadedUserImageList
Definition: sysldr.c:35
struct _MMFREE_POOL_ENTRY * Owner
Definition: mm.h:448
ULONG MmThrottleBottom
Definition: mminit.c:397
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
Definition: wdfpdo.h:430
PVOID NTAPI MiAllocatePoolPages(IN POOL_TYPE PoolType, IN SIZE_T SizeInBytes)
Definition: pool.c:420
unsigned __int64 ULONG64
Definition: imports.h:198
PVOID NTAPI MiMapPagesInZeroSpace(IN PMMPFN Pfn1, IN PFN_NUMBER NumberOfPages)
Definition: hypermap.c:111
VOID NTAPI MiUnmapPageInHyperSpace(IN PEPROCESS Process, IN PVOID Address, IN KIRQL OldIrql)
Definition: hypermap.c:91
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG NTAPI MiFreePoolPages(IN PVOID StartingAddress)
Definition: pool.c:918
struct _MM_REGION MM_REGION
NTSTATUS NTAPI MmSetExecuteOptions(IN ULONG ExecuteOptions)
Definition: pagfault.c:2573
static const WCHAR L[]
Definition: oid.c:1250
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
Definition: mm.h:345
Definition: btrfs_drv.h:1922
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
struct _MMFREE_POOL_ENTRY MMFREE_POOL_ENTRY
NTSTATUS NTAPI MmMapViewInSystemSpaceEx(_In_ PVOID Section, _Outptr_result_bytebuffer_(*ViewSize) PVOID *MappedBase, _Inout_ PSIZE_T ViewSize, _Inout_ PLARGE_INTEGER SectionOffset, _In_ ULONG_PTR Flags)
Definition: section.c:4184
NTSTATUS NTAPI MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
Definition: procsup.c:1135
VOID NTAPI MiInitBalancerThread(VOID)
Definition: balance.c:422
PMMPAGING_FILE MmPagingFile[MAX_PAGING_FILES]
Definition: pagefile.c:40
_Must_inspect_result_ _In_ USHORT NewSize
Definition: fltkernel.h:975
ULONGLONG LastPage
Definition: mm.h:192
VOID NTAPI MmGetPageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY *SwapEntry)
Definition: page.c:300
SIZE_T MmProcessCommit
Definition: freelist.c:33
Definition: typedefs.h:119
PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID)
Definition: freelist.c:45
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
Definition: spinlock.c:108
struct _MMPFN MMPFN
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
ULONG_PTR Priority
Definition: mm.h:394
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
Definition: mm.h:962
#define P(row, col)
NTSTATUS ReadStatus
Definition: mm.h:352
BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Dest, IN PULONG_PTR DirectoryTableBase)
ULONG MmThrottleTop
Definition: mminit.c:396
VOID NTAPI MmShowOutOfSpaceMessagePagingFile(VOID)
Definition: pagefile.c:119
HANDLE FileHandle
Definition: mm.h:480
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
SIZE_T MmPagedPoolCommit
Definition: freelist.c:34
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define _In_
Definition: no_sal2.h:158
LONGLONG ViewOffset
Definition: mm.h:231
PFILE_OBJECT FileObject
Definition: mm.h:199
ULONG_PTR SIZE_T
Definition: typedefs.h:80
Definition: compat.h:694
PULONG Flags
Definition: mm.h:178
PFN_NUMBER CurrentUsage
Definition: mm.h:476
USHORT PageColor
Definition: mm.h:336
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
Definition: mm.h:1567
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
PRTL_BITMAP Bitmap
Definition: mm.h:479
NTSTATUS NTAPI MmDeleteProcessAddressSpace(IN PEPROCESS Process)
NTSTATUS NTAPI MmDbgCopyMemory(IN ULONG64 Address, IN PVOID Buffer, IN ULONG Size, IN ULONG Flags)
Definition: mmdbg.c:124
NTSTATUS NTAPI MmMakePagesDirty(_In_ PEPROCESS Process, _In_ PVOID Address, _In_ ULONG Length)
Definition: section.c:4885
struct _MM_REGION * PMM_REGION
NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
Definition: balance.c:136
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID NTAPI MiUnmapPagesInZeroSpace(IN PVOID VirtualAddress, IN PFN_NUMBER NumberOfPages)
Definition: hypermap.c:183
PFN_NUMBER NTAPI MmGetPfnForProcess(struct _EPROCESS *Process, PVOID Address)
unsigned short USHORT
Definition: pedump.c:61
VOID NTAPI MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
Definition: balance.c:47
ULONG_PTR PteFrame
Definition: mm.h:390
struct _MMFREE_POOL_ENTRY * PMMFREE_POOL_ENTRY
PFN_COUNT MiUsedSwapPages
Definition: pagefile.c:52
PRTL_BITMAP EndOfPagedPoolBitmap
Definition: mm.h:458
PFN_NUMBER Total
Definition: mm.h:414
USHORT ShortFlags
Definition: mm.h:374
struct _MMPFN * PMMPFN
ULONG_PTR SWAPENTRY
Definition: mm.h:51
NTSTATUS NTAPI MmSetMemoryPriorityProcess(IN PEPROCESS Process, IN UCHAR MemoryPriority)
Definition: procsup.c:469
#define FORCEINLINE
Definition: wdftypes.h:67
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1606
FORCEINLINE PEPROCESS MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace)
Definition: mm.h:1552
_Must_inspect_result_ _In_ ULONG NewProtect
Definition: mmfuncs.h:682
USHORT Rom
Definition: mm.h:340
PMMPTE PteAddress
Definition: mm.h:358
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1035
unsigned int * PULONG
Definition: retypes.h:1
ULONG_PTR EntireFrame
Definition: mm.h:387
#define NULL
Definition: types.h:112
MMPTE OriginalPte
Definition: mm.h:379
struct _MM_SECTION_SEGMENT MM_SECTION_SEGMENT
VOID NTAPI MmDeleteAllRmaps(PFN_NUMBER Page, PVOID Context, VOID(*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address))
struct _MEMORY_AREA::@1775 SectionData
_Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex) VOID NTAPI MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet)
Definition: wslist.cpp:359
SWAPENTRY SwapEntry
Definition: mm.h:356
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
struct _MM_RMAP_ENTRY * Next
Definition: mm.h:239
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:53
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
VOID NTAPI MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: sysldr.c:1693
MM_DRIVER_VERIFIER_DATA MmVerifierData
Definition: drvmgmt.c:20
ULONG MmNumberOfPagingFiles
Definition: pagefile.c:46
PFN_NUMBER MmHighestPhysicalPage
Definition: meminit.c:31
VOID NTAPI MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type, ULONG Protect)
Definition: region.c:239
_Must_inspect_result_ _Outptr_result_bytebuffer_ ViewSize PVOID * MappedBase
Definition: mmfuncs.h:492
ULONG WsIndex
Definition: mm.h:350
enum _MI_PFN_USAGES MI_PFN_USAGES
PFN_NUMBER Blink
Definition: mm.h:361
VOID NTAPI MmSetSavedSwapEntryPage(PFN_NUMBER Page, SWAPENTRY SavedSwapEntry)
Definition: freelist.c:483
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
NTSTATUS NTAPI MmProtectSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, SIZE_T Length, ULONG Protect, PULONG OldProtect)
Definition: section.c:2015
FAST_MUTEX Lock
Definition: mm.h:172
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
Definition: mm.h:982
struct tagContext Context
Definition: acpixf.h:1034
SECTION_IMAGE_INFORMATION ImageInformation
Definition: mm.h:204
PVOID MmLastUnloadedDrivers
Definition: sysldr.c:44
#define OUT
Definition: typedefs.h:40
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:404
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
RTL_GENERIC_TABLE PageTable
Definition: mm.h:194
PFN_COUNT MiFreeSwapPages
Definition: pagefile.c:49
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY RegionListEntry
Definition: mm.h:438
VOID NTAPI _MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line)
Definition: data.c:107
BOOLEAN NTAPI MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject)
Definition: pagefile.c:102
Definition: mm.h:237
union _MMPFN::@1777 u2
VOID NTAPI MmFreeSpecialPool(IN PVOID P)
uint32_t * PULONG_PTR
Definition: typedefs.h:65
NTSTATUS NTAPI MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
Definition: pagefile.c:130
ULONG NTAPI MmGetSessionId(IN PEPROCESS Process)
Definition: session.c:179
BOOLEAN NTAPI MmUseSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag)
VOID NTAPI MmDereferenceSegment(PMM_SECTION_SEGMENT Segment)
Definition: section.c:991
struct _MM_MEMORY_CONSUMER MM_MEMORY_CONSUMER
VOID NTAPI MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit)
Definition: page.c:735
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
struct _MM_PAGED_POOL_INFO * PMM_PAGED_POOL_INFO
ULONG PagesUsed
Definition: mm.h:428
VOID NTAPI MiInitializeNonPagedPool(VOID)
Definition: pool.c:276
ULONG PagedPoolHint
Definition: mm.h:462
PVOID Address
Definition: mm.h:241
ULONG_PTR InPageError
Definition: mm.h:391
ULONG SegFlags
Definition: mm.h:190
BOOLEAN NTAPI MiRaisePoolQuota(IN POOL_TYPE PoolType, IN ULONG CurrentMaxQuota, OUT PULONG NewMaxQuota)
Definition: pool.c:1279
#define MmSetCleanPage(__P, __A)
Definition: mm.h:1157
PVOID NTAPI MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node)
#define KeGetCurrentThread
Definition: hal.h:49
struct _MMPFN * NextLRU
Definition: mm.h:406
NTSTATUS NTAPI MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1511
PMMPTE FirstPteForPagedPool
Definition: mm.h:459
UCHAR MmDisablePagingExecutive
Definition: mminit.c:25
VOID NTAPI MmInitGlobalKernelPageDirectory(VOID)
Definition: page.c:278
VOID NTAPI ExpCheckPoolAllocation(PVOID P, POOL_TYPE PoolType, ULONG Tag)
Definition: expool.c:296
MMPFNLIST MmFreePageListHead
Definition: pfnlist.c:42
NTSTATUS NTAPI MmFlushSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length, _In_opt_ PIO_STATUS_BLOCK Iosb)
Definition: section.c:4661
VOID NTAPI MmInitializeRmapList(VOID)
Definition: rmap.c:38
VOID NTAPI MmReferencePage(PFN_NUMBER Page)
Definition: freelist.c:518
ULONG NTAPI MmGetSessionIdEx(IN PEPROCESS Process)
Definition: session.c:194
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS SourceAddress
Definition: iotypes.h:1127
SINGLE_LIST_ENTRY NextStackPfn
Definition: mm.h:353
__int64 * PLONG64
Definition: basetsd.h:185
struct _MEMORY_AREA * MemoryArea
Definition: newmm.h:37
BOOLEAN NTAPI MmIsSpecialPoolAddress(IN PVOID P)
PVOID Vad
Definition: mm.h:227
NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase)
Definition: procsup.c:1110
#define APC_LEVEL
Definition: env_spec_w32.h:695
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1538
ULONG Flags
Definition: mm.h:224
PLONG64 ReferenceCount
Definition: mm.h:175
base of all file and directory entries
Definition: entries.h:82
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
Definition: mm.h:1560
ULONG_PTR NTAPI _MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, const char *file, int line)
Definition: sptab.c:258
* PKAPC_STATE
Definition: ketypes.h:1280
LONG AweReferenceCount
Definition: mm.h:380
VOID NTAPI MmFreeSwapPage(SWAPENTRY Entry)
Definition: pagefile.c:274
CHAR MI_PFN_CURRENT_PROCESS_NAME[16]
Definition: pfnlist.c:64
VOID NTAPI MmDeletePageTable(struct _EPROCESS *Process, PVOID Address)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
NTSTATUS NTAPI MmLoadSystemImage(IN PUNICODE_STRING FileName, IN PUNICODE_STRING NamePrefix OPTIONAL, IN PUNICODE_STRING LoadedName OPTIONAL, IN ULONG Flags, OUT PVOID *ModuleObject, OUT PVOID *ImageBaseAddress)
Definition: sysldr.c:2898
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Page)
Definition: freelist.c:499
PMMPDE NextPdeForPagedPoolExpansion
Definition: mm.h:461
SIZE_T MmDriverCommit
Definition: freelist.c:32
Definition: dlist.c:348
Definition: mm.h:412
Definition: fci.c:126
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68