ReactOS  0.4.15-dev-4570-g4f8bbd1
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 
33 
37 extern PVOID KernelVerifier;
39 
42 extern SIZE_T MmSharedCommit;
43 extern SIZE_T MmDriverCommit;
44 extern SIZE_T MmProcessCommit;
48 
49 extern PVOID MiDebugMapping; // internal
50 extern PMMPTE MmDebugPte; // internal
51 
52 extern KSPIN_LOCK MmPfnLock;
53 
54 struct _KTRAP_FRAME;
55 struct _EPROCESS;
57 typedef ULONG_PTR SWAPENTRY;
58 
59 //
60 // Pool Quota values
61 //
62 #define MI_QUOTA_NON_PAGED_NEEDED_PAGES 64
63 #define MI_NON_PAGED_QUOTA_MIN_RESIDENT_PAGES 200
64 #define MI_CHARGE_PAGED_POOL_QUOTA 0x80000
65 #define MI_CHARGE_NON_PAGED_POOL_QUOTA 0x10000
66 
67 //
68 // Special IRQL value (found in assertions)
69 //
70 #define MM_NOIRQL ((KIRQL)0xFFFFFFFF)
71 
72 //
73 // MmDbgCopyMemory Flags
74 //
75 #define MMDBG_COPY_WRITE 0x00000001
76 #define MMDBG_COPY_PHYSICAL 0x00000002
77 #define MMDBG_COPY_UNSAFE 0x00000004
78 #define MMDBG_COPY_CACHED 0x00000008
79 #define MMDBG_COPY_UNCACHED 0x00000010
80 #define MMDBG_COPY_WRITE_COMBINED 0x00000020
81 
82 //
83 // Maximum chunk size per copy
84 //
85 #define MMDBG_COPY_MAX_SIZE 0x8
86 
87 #if defined(_X86_) // intenal for marea.c
88 #define MI_STATIC_MEMORY_AREAS (14)
89 #else
90 #define MI_STATIC_MEMORY_AREAS (13)
91 #endif
92 
93 #define MEMORY_AREA_SECTION_VIEW (1)
94 #ifdef NEWCC
95 #define MEMORY_AREA_CACHE (2)
96 #endif
97 #define MEMORY_AREA_OWNED_BY_ARM3 (15)
98 #define MEMORY_AREA_STATIC (0x80000000)
99 
100 /* Although Microsoft says this isn't hardcoded anymore,
101  they won't be able to change it. Stuff depends on it */
102 #define MM_VIRTMEM_GRANULARITY (64 * 1024)
103 
104 #define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
105 
106 /*
107  * Additional flags for protection attributes
108  */
109 #define PAGE_WRITETHROUGH (1024)
110 #define PAGE_SYSTEM (2048)
111 
112 #define SEC_PHYSICALMEMORY (0x80000000)
113 
114 #define MC_USER (0)
115 #define MC_SYSTEM (1)
116 #define MC_MAXIMUM (2)
117 
118 #define PAGED_POOL_MASK 1
119 #define MUST_SUCCEED_POOL_MASK 2
120 #define CACHE_ALIGNED_POOL_MASK 4
121 #define QUOTA_POOL_MASK 8
122 #define SESSION_POOL_MASK 32
123 #define VERIFIER_POOL_MASK 64
124 
125 #define MAX_PAGING_FILES (16)
126 
127 // FIXME: use ALIGN_UP_BY
128 #define MM_ROUND_UP(x,s) \
129  ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
130 
131 #define MM_ROUND_DOWN(x,s) \
132  ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
133 
134 #define PAGE_FLAGS_VALID_FOR_SECTION \
135  (PAGE_READONLY | \
136  PAGE_READWRITE | \
137  PAGE_WRITECOPY | \
138  PAGE_EXECUTE | \
139  PAGE_EXECUTE_READ | \
140  PAGE_EXECUTE_READWRITE | \
141  PAGE_EXECUTE_WRITECOPY | \
142  PAGE_NOACCESS | \
143  PAGE_NOCACHE)
144 
145 #define PAGE_IS_READABLE \
146  (PAGE_READONLY | \
147  PAGE_READWRITE | \
148  PAGE_WRITECOPY | \
149  PAGE_EXECUTE_READ | \
150  PAGE_EXECUTE_READWRITE | \
151  PAGE_EXECUTE_WRITECOPY)
152 
153 #define PAGE_IS_WRITABLE \
154  (PAGE_READWRITE | \
155  PAGE_WRITECOPY | \
156  PAGE_EXECUTE_READWRITE | \
157  PAGE_EXECUTE_WRITECOPY)
158 
159 #define PAGE_IS_EXECUTABLE \
160  (PAGE_EXECUTE | \
161  PAGE_EXECUTE_READ | \
162  PAGE_EXECUTE_READWRITE | \
163  PAGE_EXECUTE_WRITECOPY)
164 
165 #define PAGE_IS_WRITECOPY \
166  (PAGE_WRITECOPY | \
167  PAGE_EXECUTE_WRITECOPY)
168 
169 //
170 // Wait entry for marking pages that are being serviced
171 //
172 #ifdef _M_IX86
173 #define MM_WAIT_ENTRY 0x7ffffc00
174 #elif defined(_M_AMD64)
175 #define MM_WAIT_ENTRY 0x7FFFFFFFFFFFFC00ULL
176 #else
177 #error Unsupported architecture!
178 #endif
179 
180 #ifdef _M_AMD64
181 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
182  InterlockedCompareExchange64((PLONG64)(PointerPte), Exchange, Comperand)
183 
184 #define InterlockedExchangePte(PointerPte, Value) \
185  InterlockedExchange64((PLONG64)(PointerPte), Value)
186 #else
187 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
188  InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
189 
190 #define InterlockedExchangePte(PointerPte, Value) \
191  InterlockedExchange((PLONG)(PointerPte), Value)
192 #endif
193 
194 typedef struct _MM_SECTION_SEGMENT
195 {
198 
199  FAST_MUTEX Lock; /* lock which protects the page directory */
200  LARGE_INTEGER RawLength; /* length of the segment which is part of the mapped file */
201  LARGE_INTEGER Length; /* absolute length of the segment */
208 
209  struct
210  {
211  ULONGLONG FileOffset; /* start offset into the file for image sections */
212  ULONG_PTR VirtualAddress; /* start offset into the address range for image sections */
214  } Image;
215 
217 
219 
222 
224 {
230 
236 
237 #define MM_PHYSICALMEMORY_SEGMENT (0x1)
238 #define MM_DATAFILE_SEGMENT (0x2)
239 #define MM_SEGMENT_INDELETE (0x4)
240 #define MM_SEGMENT_INCREATE (0x8)
241 #define MM_IMAGE_SECTION_FLUSH_DELETE (0x10)
242 
243 
244 #define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn << PAGE_SHIFT)
245 #define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 1) << PAGE_SHIFT)
246 
247 typedef struct _MEMORY_AREA
248 {
250 
256 
257  struct
258  {
262  } SectionData;
264 
265 typedef struct _MM_RMAP_ENTRY
266 {
270 #if DBG
271  PVOID Caller;
272 #endif
273 }
275 
276 #if MI_TRACE_PFNS
279 #define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
280 #define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, min(sizeof(x), sizeof(MI_PFN_CURRENT_PROCESS_NAME)))
282 void
284 {
285  if (!Process)
286  MI_SET_PROCESS2("Kernel");
287  else if (Process == (PEPROCESS)1)
288  MI_SET_PROCESS2("Hydra");
289  else
290  MI_SET_PROCESS2(Process->ImageFileName);
291 }
292 
294 void
295 MI_SET_PROCESS_USTR(PUNICODE_STRING ustr)
296 {
297  PWSTR pos, strEnd;
298  ULONG i;
299 
300  if (!ustr->Buffer || ustr->Length == 0)
301  {
303  return;
304  }
305 
306  pos = strEnd = &ustr->Buffer[ustr->Length / sizeof(WCHAR)];
307  while ((*pos != L'\\') && (pos > ustr->Buffer))
308  pos--;
309 
310  if (*pos == L'\\')
311  pos++;
312 
313  for (i = 0; i < sizeof(MI_PFN_CURRENT_PROCESS_NAME) && pos <= strEnd; i++, pos++)
315 }
316 #else
317 #define MI_SET_USAGE(x)
318 #define MI_SET_PROCESS(x)
319 #define MI_SET_PROCESS2(x)
320 #endif
321 
322 typedef enum _MI_PFN_USAGES
323 {
350 } MI_PFN_USAGES;
351 
352 //
353 // These two mappings are actually used by Windows itself, based on the ASSERTS
354 //
355 #define StartOfAllocation ReadInProgress
356 #define EndOfAllocation WriteInProgress
357 
358 typedef struct _MMPFNENTRY
359 {
361  USHORT ReadInProgress:1; // StartOfAllocation
362  USHORT WriteInProgress:1; // EndOfAllocation
370 } MMPFNENTRY;
371 
372 // Mm internal
373 typedef struct _MMPFN
374 {
375  union
376  {
382 
383  // HACK for ROSPFN
385  } u1;
387  union
388  {
391  } u2;
392  union
393  {
394  struct
395  {
398  };
399  struct
400  {
403  } e2;
404  } u3;
405  union
406  {
409 
410  // HACK for ROSPFN
412  };
413  union
414  {
416  struct
417  {
424  };
425  } u4;
426 #if MI_TRACE_PFNS
427  MI_PFN_USAGES PfnUsage;
428  CHAR ProcessName[16];
429 #define MI_SET_PFN_PROCESS_NAME(pfn, x) memcpy(pfn->ProcessName, x, min(sizeof(x), sizeof(pfn->ProcessName)))
430  PVOID CallSite;
431 #endif
432 
433  // HACK until WS lists are supported
435  struct _MMPFN* NextLRU;
437 } MMPFN, *PMMPFN;
438 
439 extern PMMPFN MmPfnDatabase;
440 
441 typedef struct _MMPFNLIST
442 {
448 
454 
455 typedef struct _MM_MEMORY_CONSUMER
456 {
461 
462 typedef struct _MM_REGION
463 {
469 
470 // Mm internal
471 /* Entry describing free pool memory */
472 typedef struct _MMFREE_POOL_ENTRY
473 {
479 
480 /* Signature of a freed block */
481 #define MM_FREE_POOL_SIGNATURE 'ARM3'
482 
483 /* Paged pool information */
484 typedef struct _MM_PAGED_POOL_INFO
485 {
495 
497 
498 /* Page file information */
499 typedef struct _MMPAGING_FILE
500 {
510 }
512 
514 
515 typedef VOID
519  SIZE_T Length,
520  ULONG OldType,
521  ULONG OldProtect,
522  ULONG NewType,
524 );
525 
526 typedef VOID
528  PVOID Context,
530  PVOID Address,
532  SWAPENTRY SwapEntry,
533  BOOLEAN Dirty
534 );
535 
536 //
537 // Mm copy support for Kd
538 //
539 NTSTATUS
540 NTAPI
543  IN PVOID Buffer,
544  IN ULONG Size,
545  IN ULONG Flags
546 );
547 
548 //
549 // Determines if a given address is a session address
550 //
551 BOOLEAN
552 NTAPI
555 );
556 
557 ULONG
558 NTAPI
561 );
562 
563 ULONG
564 NTAPI
567 );
568 
569 /* marea.c *******************************************************************/
570 
571 NTSTATUS
572 NTAPI
575  ULONG Type,
577  SIZE_T Length,
578  ULONG Protection,
580  ULONG AllocationFlags,
581  ULONG AllocationGranularity
582 );
583 
585 NTAPI
588  PVOID Address
589 );
590 
591 NTSTATUS
592 NTAPI
597  PVOID FreePageContext
598 );
599 
600 VOID
601 NTAPI
604  PMMVAD Vad);
605 
607 NTAPI
610  PVOID Address,
611  SIZE_T Length
612 );
613 
614 PVOID
615 NTAPI
616 MmFindGap(
618  SIZE_T Length,
619  ULONG_PTR Granularity,
620  BOOLEAN TopDown
621 );
622 
623 VOID
624 NTAPI
627 
628 VOID
629 NTAPI
631 
632 /* npool.c *******************************************************************/
633 
634 CODE_SEG("INIT")
635 VOID
636 NTAPI
638 
639 PVOID
640 NTAPI
643  IN SIZE_T SizeInBytes
644 );
645 
646 POOL_TYPE
647 NTAPI
650 );
651 
652 ULONG
653 NTAPI
655  IN PVOID StartingAddress
656 );
657 
658 /* pool.c *******************************************************************/
659 
661 BOOLEAN
662 NTAPI
663 MmRaisePoolQuota(
667 );
668 
670 VOID
671 NTAPI
672 MmReturnPoolQuota(
675 );
676 
677 /* mdl.c *********************************************************************/
678 
679 VOID
680 NTAPI
682  PMDL Mdl,
683  PPFN_NUMBER Pages
684 );
685 
686 /* mminit.c ******************************************************************/
687 
688 VOID
689 NTAPI
690 MmInit1(
691  VOID
692 );
693 
694 CODE_SEG("INIT")
695 BOOLEAN
696 NTAPI
697 MmInitSystem(IN ULONG Phase,
698  IN PLOADER_PARAMETER_BLOCK LoaderBlock);
699 
700 
701 /* pagefile.c ****************************************************************/
702 
703 SWAPENTRY
704 NTAPI
706 
707 VOID
708 NTAPI
710 
711 CODE_SEG("INIT")
712 VOID
713 NTAPI
715 
716 BOOLEAN
717 NTAPI
719 
720 NTSTATUS
721 NTAPI
723  SWAPENTRY SwapEntry,
725 );
726 
727 NTSTATUS
728 NTAPI
730  SWAPENTRY SwapEntry,
732 );
733 
734 VOID
735 NTAPI
737 
738 NTSTATUS
739 NTAPI
742  _In_ ULONG PageFileIndex,
743  _In_ ULONG_PTR PageFileOffset);
744 
745 /* process.c ****************************************************************/
746 
747 NTSTATUS
748 NTAPI
751  IN PEPROCESS Clone OPTIONAL,
752  IN PVOID Section OPTIONAL,
753  IN OUT PULONG Flags,
755 );
756 
757 NTSTATUS
758 NTAPI
761  IN PINITIAL_PEB InitialPeb,
762  OUT PPEB *BasePeb
763 );
764 
765 NTSTATUS
766 NTAPI
770  IN PINITIAL_TEB InitialTeb,
771  OUT PTEB* BaseTeb
772 );
773 
774 VOID
775 NTAPI
778  PTEB Teb
779 );
780 
781 VOID
782 NTAPI
784 
785 VOID
786 NTAPI
788 
789 ULONG
790 NTAPI
792 
793 NTSTATUS
794 NTAPI
797  IN UCHAR MemoryPriority
798 );
799 
800 /* i386/pfault.c *************************************************************/
801 
802 NTSTATUS
803 NTAPI
805  ULONG Cs,
806  PULONG Eip,
807  PULONG Eax,
808  ULONG Cr2,
810 );
811 
812 /* special.c *****************************************************************/
813 
814 VOID
815 NTAPI
817 
818 BOOLEAN
819 NTAPI
822  IN ULONG Tag);
823 
824 BOOLEAN
825 NTAPI
827  IN PVOID P);
828 
829 BOOLEAN
830 NTAPI
832  IN PVOID P);
833 
834 PVOID
835 NTAPI
838  IN ULONG Tag,
840  IN ULONG SpecialType);
841 
842 VOID
843 NTAPI
845  IN PVOID P);
846 
847 /* mm.c **********************************************************************/
848 
849 NTSTATUS
850 NTAPI
852  IN ULONG FaultCode,
853  IN PVOID Address,
855  IN PVOID TrapInformation
856 );
857 
858 /* process.c *****************************************************************/
859 
860 PVOID
861 NTAPI
863 
864 VOID
865 NTAPI
867  BOOLEAN GuiStack);
868 
869 /* balance.c *****************************************************************/
870 
871 CODE_SEG("INIT")
872 VOID
873 NTAPI
875  ULONG Consumer,
876  NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
877 );
878 
879 CODE_SEG("INIT")
880 VOID
881 NTAPI
883  ULONG NrAvailablePages,
884  ULONG NrSystemPages
885 );
886 
887 NTSTATUS
888 NTAPI
890  ULONG Consumer,
892 );
893 
894 NTSTATUS
895 NTAPI
897  ULONG Consumer,
898  BOOLEAN MyWait,
899  PPFN_NUMBER AllocatedPage
900 );
901 
902 CODE_SEG("INIT")
903 VOID
904 NTAPI
906 
907 VOID
908 NTAPI
910 
911 /* rmap.c **************************************************************/
912 #define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff)
913 #define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
914 
915 VOID
916 NTAPI
919  struct _MM_RMAP_ENTRY* ListHead
920 );
921 
922 struct _MM_RMAP_ENTRY*
923 NTAPI
925 
926 VOID
927 NTAPI
930  struct _EPROCESS *Process,
931  PVOID Address
932 );
933 
934 VOID
935 NTAPI
938  PVOID Context,
939  VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
940 );
941 
942 VOID
943 NTAPI
946  struct _EPROCESS *Process,
947  PVOID Address
948 );
949 
950 CODE_SEG("INIT")
951 VOID
952 NTAPI
954 
955 NTSTATUS
956 NTAPI
958 
960 NTAPI
963 
964 /* freelist.c **********************************************************/
971 KIRQL
972 MiAcquirePfnLock(VOID)
973 {
975 }
976 
981 VOID
982 MiReleasePfnLock(
984 {
986 }
987 
992 VOID
993 MiAcquirePfnLockAtDpcLevel(VOID)
994 {
995  PKSPIN_LOCK_QUEUE LockQueue;
996 
998  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
999  KeAcquireQueuedSpinLockAtDpcLevel(LockQueue);
1000 }
1001 
1006 VOID
1007 MiReleasePfnLockFromDpcLevel(VOID)
1008 {
1009  PKSPIN_LOCK_QUEUE LockQueue;
1010 
1011  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
1012  KeReleaseQueuedSpinLockFromDpcLevel(LockQueue);
1014 }
1015 
1016 #define MI_ASSERT_PFN_LOCK_HELD() NT_ASSERT((KeGetCurrentIrql() >= DISPATCH_LEVEL) && (MmPfnLock != 0))
1017 
1019 PMMPFN
1021 {
1022  PMMPFN Page;
1023  extern RTL_BITMAP MiPfnBitMap;
1024 
1025  /* Make sure the PFN number is valid */
1026  if (Pfn > MmHighestPhysicalPage) return NULL;
1027 
1028  /* Make sure this page actually has a PFN entry */
1029  if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL;
1030 
1031  /* Get the entry */
1032  Page = &MmPfnDatabase[Pfn];
1033 
1034  /* Return it */
1035  return Page;
1036 };
1037 
1039 PFN_NUMBER
1041 {
1042  //
1043  // This will return the Page Frame Number (PFN) from the MMPFN
1044  //
1045  return Pfn1 - MmPfnDatabase;
1046 }
1047 
1048 PFN_NUMBER
1049 NTAPI
1050 MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast);
1051 
1052 PFN_NUMBER
1053 NTAPI
1055 
1056 VOID
1057 NTAPI
1059  IN BOOLEAN StatusOnly
1060 );
1061 
1062 VOID
1063 NTAPI
1065  VOID
1066 );
1067 
1068 /* hypermap.c *****************************************************************/
1069 PVOID
1070 NTAPI
1072  IN PFN_NUMBER Page,
1073  IN PKIRQL OldIrql);
1074 
1075 VOID
1076 NTAPI
1078  IN PVOID Address,
1079  IN KIRQL OldIrql);
1080 
1081 PVOID
1082 NTAPI
1084  IN PFN_NUMBER NumberOfPages);
1085 
1086 VOID
1087 NTAPI
1089  IN PFN_NUMBER NumberOfPages);
1090 
1091 /* i386/page.c *********************************************************/
1092 
1093 NTSTATUS
1094 NTAPI
1096  struct _EPROCESS* Process,
1097  PVOID Address,
1098  ULONG flProtect,
1100 );
1101 
1102 NTSTATUS
1103 NTAPI
1105  struct _EPROCESS* Process,
1106  PVOID Address,
1107  ULONG flProtect,
1109 );
1110 
1111 ULONG
1112 NTAPI
1114  struct _EPROCESS* Process,
1115  PVOID Address);
1116 
1117 VOID
1118 NTAPI
1120  struct _EPROCESS* Process,
1121  PVOID Address,
1122  ULONG flProtect
1123 );
1124 
1125 BOOLEAN
1126 NTAPI
1128  struct _EPROCESS* Process,
1129  PVOID Address
1130 );
1131 
1132 BOOLEAN
1133 NTAPI
1135  struct _EPROCESS* Process,
1136  PVOID Address
1137 );
1138 
1139 CODE_SEG("INIT")
1140 VOID
1141 NTAPI
1143 
1144 VOID
1145 NTAPI
1148  PVOID Address,
1149  SWAPENTRY* SwapEntry
1150 );
1151 
1152 NTSTATUS
1153 NTAPI
1156  PVOID Address,
1157  SWAPENTRY SwapEntry
1158 );
1159 
1160 VOID
1161 NTAPI
1164  PVOID Address,
1165  SWAPENTRY *SwapEntry);
1166 
1167 BOOLEAN
1168 NTAPI
1171  PVOID Address
1172 );
1173 
1174 PFN_NUMBER
1175 NTAPI
1176 MmAllocPage(
1177  ULONG Consumer
1178 );
1179 
1180 VOID
1181 NTAPI
1183 
1184 VOID
1185 NTAPI
1187 
1188 ULONG
1189 NTAPI
1191 
1192 BOOLEAN
1193 NTAPI
1195 
1196 VOID
1197 NTAPI
1199  PFN_NUMBER Page,
1200  SWAPENTRY SavedSwapEntry);
1201 
1202 SWAPENTRY
1203 NTAPI
1205 
1206 VOID
1207 NTAPI
1210  PVOID Address
1211 );
1212 
1213 VOID
1214 NTAPI
1216 #define MmSetCleanPage(__P, __A) MmSetDirtyBit(__P, __A, FALSE)
1217 #define MmSetDirtyPage(__P, __A) MmSetDirtyBit(__P, __A, TRUE)
1218 
1219 VOID
1220 NTAPI
1222  struct _EPROCESS *Process,
1223  PVOID Address
1224 );
1225 
1226 PFN_NUMBER
1227 NTAPI
1229  struct _EPROCESS *Process,
1230  PVOID Address
1231 );
1232 
1233 BOOLEAN
1234 NTAPI
1236  IN ULONG MinWs,
1237  IN PEPROCESS Dest,
1238  IN PULONG_PTR DirectoryTableBase
1239 );
1240 
1241 CODE_SEG("INIT")
1242 NTSTATUS
1243 NTAPI
1246  IN PULONG_PTR DirectoryTableBase
1247 );
1248 
1249 CODE_SEG("INIT")
1250 NTSTATUS
1251 NTAPI
1254 );
1255 
1256 NTSTATUS
1257 NTAPI
1258 MmSetExecuteOptions(IN ULONG ExecuteOptions);
1259 
1260 NTSTATUS
1261 NTAPI
1262 MmGetExecuteOptions(IN PULONG ExecuteOptions);
1263 
1264 VOID
1265 NTAPI
1268  PVOID Address,
1269  BOOLEAN* WasDirty,
1271 );
1272 
1273 /* arch/procsup.c ************************************************************/
1274 
1275 BOOLEAN
1278  _In_ PULONG_PTR DirectoryTableBase);
1279 
1280 /* wset.c ********************************************************************/
1281 
1282 NTSTATUS
1284  ULONG Target,
1285  ULONG Priority,
1286  PULONG NrFreedPages
1287 );
1288 
1289 /* region.c ************************************************************/
1290 
1291 NTSTATUS
1292 NTAPI
1296  PLIST_ENTRY RegionListHead,
1297  PVOID StartAddress,
1298  SIZE_T Length,
1299  ULONG NewType,
1300  ULONG NewProtect,
1301  PMM_ALTER_REGION_FUNC AlterFunc
1302 );
1303 
1304 VOID
1305 NTAPI
1307  PLIST_ENTRY RegionListHead,
1308  SIZE_T Length,
1309  ULONG Type,
1310  ULONG Protect
1311 );
1312 
1313 PMM_REGION
1314 NTAPI
1315 MmFindRegion(
1317  PLIST_ENTRY RegionListHead,
1318  PVOID Address,
1319  PVOID* RegionBaseAddress
1320 );
1321 
1322 /* section.c *****************************************************************/
1323 
1324 #define PFN_FROM_SSE(E) ((PFN_NUMBER)((E) >> PAGE_SHIFT))
1325 #define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
1326 #define MM_IS_WAIT_PTE(E) \
1327  (IS_SWAP_FROM_SSE(E) && SWAPENTRY_FROM_SSE(E) == MM_WAIT_ENTRY)
1328 #define MAKE_PFN_SSE(P) ((ULONG_PTR)((P) << PAGE_SHIFT))
1329 #define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
1330 #define MAKE_SWAP_SSE(S) (((ULONG_PTR)(S) << 1) | 0x1)
1331 #define DIRTY_SSE(E) ((E) | 2)
1332 #define CLEAN_SSE(E) ((E) & ~2)
1333 #define IS_DIRTY_SSE(E) ((E) & 2)
1334 #define WRITE_SSE(E) ((E) | 4)
1335 #define IS_WRITE_SSE(E) ((E) & 4)
1336 #ifdef _WIN64
1337 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFFFF000ULL)
1338 #else
1339 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
1340 #endif
1341 #define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
1342 #define MAX_SHARE_COUNT 0x1FF
1343 #define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
1344 #define BUMPREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) + 1) << 3) | ((E) & 0x7))
1345 #define DECREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) - 1) << 3) | ((E) & 0x7))
1346 
1347 VOID
1348 NTAPI
1350  const char *file,
1351  int line);
1352 
1353 #define MmLockSectionSegment(x) _MmLockSectionSegment(x,__FILE__,__LINE__)
1354 
1355 VOID
1356 NTAPI
1358  const char *file,
1359  int line);
1360 
1361 #define MmUnlockSectionSegment(x) _MmUnlockSectionSegment(x,__FILE__,__LINE__)
1362 
1363 VOID
1364 NTAPI
1366  OUT PSECTION_IMAGE_INFORMATION ImageInformation
1367 );
1368 
1370 NTAPI
1372  IN PVOID Section
1373 );
1374 NTSTATUS
1375 NTAPI
1377  IN PVOID Address,
1379 );
1380 
1381 NTSTATUS
1382 NTAPI
1384  IN PVOID Section,
1386 );
1387 
1388 NTSTATUS
1389 NTAPI
1392  PVOID Address,
1395 );
1396 
1397 NTSTATUS
1398 NTAPI
1403  SIZE_T Length,
1404  ULONG Protect,
1405  PULONG OldProtect
1406 );
1407 
1408 CODE_SEG("INIT")
1409 NTSTATUS
1410 NTAPI
1412 
1413 NTSTATUS
1414 NTAPI
1418  PVOID Address,
1419  BOOLEAN Locked
1420 );
1421 
1422 NTSTATUS
1423 NTAPI
1427  PVOID Address,
1429 );
1430 
1431 CODE_SEG("INIT")
1432 NTSTATUS
1433 NTAPI
1435 
1436 NTSTATUS
1437 NTAPI
1441  PVOID Address,
1442  BOOLEAN Locked
1443 );
1444 
1445 VOID
1446 NTAPI
1448 
1449 /* Exported from NT 6.2 Onward. We keep it internal. */
1450 NTSTATUS
1451 NTAPI
1453  _In_ PVOID Section,
1458  );
1459 
1460 BOOLEAN
1461 NTAPI
1465  _In_ ULONG Length);
1466 
1467 NTSTATUS
1468 NTAPI
1471  _In_ PVOID Address,
1472  _In_ ULONG Length);
1473 
1474 NTSTATUS
1475 NTAPI
1479  _In_ ULONG Length,
1481 
1482 NTSTATUS
1483 NTAPI
1487  _In_ ULONG Length,
1488  _In_ PLARGE_INTEGER ValidDataLength);
1489 
1490 BOOLEAN
1491 NTAPI
1495  _In_ ULONG Length);
1496 
1497 BOOLEAN
1498 NTAPI
1503  BOOLEAN PageOut);
1504 
1505 BOOLEAN
1506 NTAPI
1510  BOOLEAN Dirty,
1511  BOOLEAN PageOut,
1512  ULONG_PTR *InEntry);
1513 
1519 VOID
1520 NTAPI
1521 MmDereferenceSegmentWithLock(
1524 
1528 VOID
1529 MmDereferenceSegment(PMM_SECTION_SEGMENT Segment)
1530 {
1531  MmDereferenceSegmentWithLock(Segment, MM_NOIRQL);
1532 }
1533 
1534 NTSTATUS
1535 NTAPI
1537  _In_ PVOID Section,
1539 
1540 /* sptab.c *******************************************************************/
1541 
1542 NTSTATUS
1543 NTAPI
1546  ULONG_PTR Entry,
1547  const char *file,
1548  int line);
1549 
1550 ULONG_PTR
1551 NTAPI
1554  const char *file,
1555  int line);
1556 
1557 #define MmSetPageEntrySectionSegment(S,O,E) _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__)
1558 
1559 #define MmGetPageEntrySectionSegment(S,O) _MmGetPageEntrySectionSegment(S,O,__FILE__,__LINE__)
1560 
1561 /* sysldr.c ******************************************************************/
1562 
1563 CODE_SEG("INIT")
1564 VOID
1565 NTAPI
1567  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1568 );
1569 
1570 CODE_SEG("INIT")
1571 BOOLEAN
1572 NTAPI
1574  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1575 );
1576 
1577 BOOLEAN
1578 NTAPI
1580 
1581 VOID
1582 NTAPI
1584 
1585 NTSTATUS
1586 NTAPI
1589  IN PUNICODE_STRING NamePrefix OPTIONAL,
1590  IN PUNICODE_STRING LoadedName OPTIONAL,
1591  IN ULONG Flags,
1592  OUT PVOID *ModuleObject,
1593  OUT PVOID *ImageBaseAddress
1594 );
1595 
1596 NTSTATUS
1597 NTAPI
1599  IN PVOID ImageHandle
1600 );
1601 
1602 NTSTATUS
1603 NTAPI
1605  IN HANDLE ImageHandle,
1606  IN BOOLEAN PurgeSection
1607 );
1608 
1609 NTSTATUS
1610 NTAPI
1612  IN PLDR_DATA_TABLE_ENTRY LdrEntry,
1613  IN PLIST_ENTRY ListHead
1614 );
1615 
1616 VOID
1617 NTAPI
1619  IN PLDR_DATA_TABLE_ENTRY LdrEntry);
1620 
1621 /* procsup.c *****************************************************************/
1622 
1623 NTSTATUS
1624 NTAPI
1626  IN PVOID StackPointer
1627 );
1628 
1629 
1631 VOID
1633 {
1634  KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1635 }
1636 
1638 VOID
1640 {
1641  KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1642 }
1643 
1645 PEPROCESS
1647 {
1648  if (AddressSpace == MmKernelAddressSpace) return NULL;
1650 }
1651 
1653 PMMSUPPORT
1655 {
1656  return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->Vm;
1657 }
1658 
1660 PMMSUPPORT
1662 {
1663  return MmKernelAddressSpace;
1664 }
1665 
1666 
1667 /* expool.c ******************************************************************/
1668 
1669 VOID
1670 NTAPI
1672  PVOID P,
1674  ULONG Tag);
1675 
1676 VOID
1677 NTAPI
1679  IN PVOID P);
1680 
1681 
1682 /* mmsup.c *****************************************************************/
1683 
1684 NTSTATUS
1685 NTAPI
1687  IN SIZE_T WorkingSetMinimumInBytes,
1688  IN SIZE_T WorkingSetMaximumInBytes,
1689  IN ULONG SystemCache,
1690  IN BOOLEAN IncreaseOkay);
1691 
1692 
1693 /* session.c *****************************************************************/
1694 
1696 NTSTATUS
1697 NTAPI
1698 MmAttachSession(
1699  _Inout_ PVOID SessionEntry,
1701 
1703 VOID
1704 NTAPI
1705 MmDetachSession(
1706  _Inout_ PVOID SessionEntry,
1708 
1709 VOID
1710 NTAPI
1712  _Inout_ PVOID SessionEntry);
1713 
1714 PVOID
1715 NTAPI
1717  _In_ ULONG SessionId);
1718 
1720 VOID
1721 NTAPI
1722 MmSetSessionLocaleId(
1723  _In_ LCID LocaleId);
1724 
1725 /* shutdown.c *****************************************************************/
1726 
1727 VOID
1728 MmShutdownSystem(IN ULONG Phase);
1729 
1730 /* virtual.c *****************************************************************/
1731 
1732 NTSTATUS
1733 NTAPI
1734 MmCopyVirtualMemory(IN PEPROCESS SourceProcess,
1736  IN PEPROCESS TargetProcess,
1740  OUT PSIZE_T ReturnSize);
1741 
1742 /* wslist.cpp ****************************************************************/
1743 _Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex)
1744 VOID
1745 NTAPI
1747 
1748 #ifdef __cplusplus
1749 } // extern "C"
1750 
1751 namespace ntoskrnl
1752 {
1753 using MiPfnLockGuard = const KiQueuedSpinLockGuard<LockQueuePfnLock>;
1754 } // namespace ntoskrnl
1755 
1756 #endif
VOID NTAPI MmDereferencePage(PFN_NUMBER Page)
Definition: freelist.c:565
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
NTSTATUS NTAPI MmExtendSection(_In_ PVOID Section, _Inout_ PLARGE_INTEGER NewSize)
Definition: section.c:5124
PRTL_BITMAP PagedPoolAllocationMap
Definition: mm.h:486
PULONG Buffer
Definition: typedefs.h:91
ULONG_PTR VirtualAddress
Definition: mm.h:212
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:749
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1755
BOOLEAN WriteCopy
Definition: mm.h:206
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:1263
VOID NTAPI MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: sysldr.c:1635
PEPROCESS Process
Definition: mm.h:268
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]
Definition: balance.c:30
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:516
VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject)
#define _In_opt_
Definition: ms_sal.h:309
ULONG Type
Definition: mm.h:251
ULONG MI_PFN_CURRENT_USAGE
Definition: pfnlist.c:63
struct _MEMORY_AREA * PMEMORY_AREA
#define _Inout_
Definition: ms_sal.h:378
_In_ ULONG Mode
Definition: hubbusif.h:303
ULONG Characteristics
Definition: mm.h:213
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)
#define _Out_
Definition: ms_sal.h:345
_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
_Requires_lock_held_(PspQuotaLock) BOOLEAN NTAPI MmRaisePoolQuota(_In_ POOL_TYPE PoolType
NTSTATUS NTAPI MmGetFileNameForSection(IN PVOID Section, OUT POBJECT_NAME_INFORMATION *ModuleName)
Definition: section.c:1882
ULONG PFN_COUNT
Definition: mmtypes.h:102
ULONG NTAPI MmGetPageProtect(struct _EPROCESS *Process, PVOID Address)
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Page)
Definition: freelist.c:558
USHORT ReadInProgress
Definition: mm.h:361
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:4810
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:421
ULONG Signature
Definition: mm.h:476
ULONG PagesTarget
Definition: mm.h:458
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:2272
VOID NTAPI MmDeleteKernelStack(PVOID Stack, BOOLEAN GuiStack)
VOID MmShutdownSystem(IN ULONG Phase)
Definition: shutdown.c:77
MMLISTS ListName
Definition: mm.h:444
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1639
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:4665
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion(PMMSUPPORT AddressSpace, PVOID Address, SIZE_T Length)
Definition: marea.c:106
PMM_RMAP_ENTRY RmapListHead
Definition: mm.h:411
struct _MM_PAGED_POOL_INFO MM_PAGED_POOL_INFO
NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID)
Definition: section.c:2170
Definition: mm.h:462
ULONG SectionCount
Definition: mm.h:203
struct _MM_RMAP_ENTRY MM_RMAP_ENTRY
LONG NTSTATUS
Definition: precomp.h:26
PFN_NUMBER Size
Definition: mm.h:501
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:1050
BOOLEAN NTAPI MmIsSessionAddress(IN PVOID Address)
Definition: session.c:48
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1080
PFN_NUMBER Flink
Definition: mm.h:377
struct _EPROCESS * PEPROCESS
Definition: nt_native.h:30
LIST_ENTRY RegionListHead
Definition: mm.h:261
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
Definition: balance.c:73
union _MMPFN::@1756 u4
SIZE_T MmSharedCommit
Definition: freelist.c:31
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:280
VOID(* PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
Definition: mm.h:527
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
USHORT Modified
Definition: mm.h:360
PMM_SECTION_SEGMENT Segment
Definition: mm.h:260
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:1091
struct _MMPFNENTRY MMPFNENTRY
PVOID MmTriageActionTaken
Definition: drvmgmt.c:27
USHORT RemovalRequested
Definition: mm.h:366
PVOID MmUnloadedDrivers
Definition: sysldr.c:43
_IRQL_requires_(DISPATCH_LEVEL)) VOID NTAPI MmDereferenceSegmentWithLock(_In_ PMM_SECTION_SEGMENT Segment
BOOLEAN NTAPI MmPurgeSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length)
Definition: section.c:4718
DWORD LCID
Definition: nls.h:13
PFILE_OBJECT FileObject
Definition: mm.h:506
PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation(PFN_NUMBER Page, PLARGE_INTEGER Offset)
Definition: sptab.c:360
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:1903
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
SIZE_T MmTotalNonPagedPoolQuota
Definition: pool.c:27
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
Definition: marea.c:60
_Use_decl_annotations_ VOID NTAPI MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet)
Definition: wslist.cpp:369
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
USHORT ReferenceCount
Definition: mm.h:396
PVOID NTAPI MmAllocateSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag, IN POOL_TYPE PoolType, IN ULONG SpecialType)
MMPFNLIST MmStandbyPageListHead
Definition: pfnlist.c:43
USHORT PageLocation
Definition: mm.h:365
PMMPFN MmPfnDatabase
Definition: freelist.c:24
_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:445
enum _MMLISTS MMLISTS
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
MMWSLE Wsle
Definition: mm.h:434
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
_IRQL_raises_(DISPATCH_LEVEL) _IRQL_requires_max_(DISPATCH_LEVEL) _Requires_lock_not_held_(MmPfnLock) _Acquires_lock_(MmPfnLock) _IRQL_saves_ FORCEINLINE KIRQL MiAcquirePfnLock(VOID)
Definition: mm.h:965
USHORT PrototypePte
Definition: mm.h:363
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
UCHAR KIRQL
Definition: env_spec_w32.h:591
MMPFNENTRY e1
Definition: mm.h:397
union _MMPFN::@1752 u2
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG Magic
Definition: mm.h:254
_Releases_lock_(MmPfnLock)) _When_(OldIrql !
NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, PSIZE_T ResultLength)
Definition: section.c:2066
BOOLEAN NTAPI MmIsPagePresent(struct _EPROCESS *Process, PVOID Address)
VOID NTAPI MmInitializeMemoryConsumer(ULONG Consumer, NTSTATUS(*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed))
Definition: balance.c:58
VOID NTAPI MmInitPagingFile(VOID)
Definition: pagefile.c:255
USHORT CacheAttribute
Definition: mm.h:367
PLARGE_INTEGER BOOLEAN ForceDirty
Definition: section.c:4918
#define MC_MAXIMUM
Definition: mm.h:116
#define L(x)
Definition: ntvdm.h:50
VOID NTAPI MmZeroPageThread(VOID)
Definition: zeropage.c:36
NTSTATUS NTAPI MmFlushSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length, _Out_opt_ PIO_STATUS_BLOCK Iosb)
Definition: section.c:4830
#define MM_NOIRQL
Definition: mm.h:70
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:1829
ULONG_PTR MustBeCached
Definition: mm.h:423
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:2261
PMMPTE LastPteForPagedPool
Definition: mm.h:489
ULONG Type
Definition: mm.h:464
struct _MM_MEMORY_CONSUMER * PMM_MEMORY_CONSUMER
#define MI_SET_PROCESS(x)
Definition: mm.h:318
struct _MMPFNLIST * PMMPFNLIST
ULONG_PTR ShareCount
Definition: mm.h:390
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:204
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
VOID NTAPI MmRebalanceMemoryConsumers(VOID)
Definition: balance.c:270
long LONG
Definition: pedump.c:60
USHORT ParityError
Definition: mm.h:369
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:446
PKEVENT Event
Definition: mm.h:379
#define MI_SET_PROCESS2(x)
Definition: mm.h:319
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:474
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER _Outptr_ PVOID * TargetAddress
Definition: iotypes.h:1035
struct _MM_SECTION_SEGMENT::@1749 Image
struct _MMPAGING_FILE * PMMPAGING_FILE
PVOID NTAPI MiMapPageInHyperSpace(IN PEPROCESS Process, IN PFN_NUMBER Page, IN PKIRQL OldIrql)
Definition: hypermap.c:28
_IRQL_requires_max_(DISPATCH_LEVEL) _Requires_lock_not_held_(MmPfnLock) FORCEINLINE VOID MmDereferenceSegment(PMM_SECTION_SEGMENT Segment)
Definition: mm.h:1525
NTSTATUS NTAPI MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1892
NTSTATUS NTAPI MmGetExecuteOptions(IN PULONG ExecuteOptions)
Definition: pagfault.c:2579
BOOLEAN Locked
Definition: mm.h:207
unsigned char BOOLEAN
SIZE_T AllocatedPagedPool
Definition: mm.h:493
SIZE_T MmPeakCommitment
Definition: freelist.c:35
static WCHAR Address[46]
Definition: ping.c:68
NTSTATUS NTAPI MmPageOutSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, ULONG_PTR Entry)
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:420
SIZE_T Length
Definition: mm.h:466
_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 _In_
Definition: ms_sal.h:308
Definition: parser.c:48
NTSTATUS NTAPI MmPageOutPhysicalAddress(PFN_NUMBER Page)
Definition: rmap.c:51
Definition: bufpool.h:45
PFN_NUMBER Page
Definition: section.c:4924
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:436
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
VOID NTAPI MmQuitNextSession(_Inout_ PVOID SessionEntry)
Definition: session.c:1030
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
Definition: procsup.c:468
SIZE_T PagedPoolCommit
Definition: mm.h:492
PFN_NUMBER MaximumSize
Definition: mm.h:502
PFN_NUMBER MinimumSize
Definition: mm.h:503
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:197
UNICODE_STRING PageFileName
Definition: mm.h:507
_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
ULONG Protect
Definition: mm.h:465
USHORT WriteInProgress
Definition: mm.h:362
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:201
PMMPTE MmDebugPte
Definition: mmdbg.c:31
ULONGLONG FileOffset
Definition: mm.h:211
FAST_MUTEX
Definition: extypes.h:17
BOOLEAN NTAPI MmIsSpecialPoolAddressFree(IN PVOID P)
PFN_COUNT Size
Definition: mm.h:475
int64_t LONGLONG
Definition: typedefs.h:68
VOID NTAPI MmCleanProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1251
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:322
LONG64 RefCount
Definition: mm.h:196
POOL_TYPE NTAPI MmDeterminePoolType(IN PVOID VirtualAddress)
Definition: pool.c:408
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1165
#define ASSERT(a)
Definition: mode.c:44
PFN_NUMBER FreeSpace
Definition: mm.h:504
struct _MMPFNLIST MMPFNLIST
#define MAX_PAGING_FILES
Definition: mm.h:125
__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:509
Definition: mm.h:472
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:459
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:234
PLARGE_INTEGER BOOLEAN BOOLEAN PageOut
Definition: section.c:4921
struct _MMPAGING_FILE MMPAGING_FILE
BOOLEAN DeleteInProgress
Definition: mm.h:253
BOOLEAN NTAPI MmIsDisabledPage(struct _EPROCESS *Process, PVOID Address)
LARGE_INTEGER RawLength
Definition: mm.h:200
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)
_When_(OldIrql==MM_NOIRQL, _IRQL_requires_max_(DISPATCH_LEVEL)) _When_(OldIrql
_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
_IRQL_requires_min_(DISPATCH_LEVEL) _Requires_lock_not_held_(MmPfnLock) _Acquires_lock_(MmPfnLock) FORCEINLINE VOID MiAcquirePfnLockAtDpcLevel(VOID)
Definition: mm.h:988
PFN_NUMBER NTAPI MmAllocPage(ULONG Consumer)
Definition: freelist.c:601
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
_Requires_lock_not_held_(MmPfnLock)) _When_(OldIrql !
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:249
LIST_ENTRY MmLoadedUserImageList
Definition: sysldr.c:35
struct _MMFREE_POOL_ENTRY * Owner
Definition: mm.h:477
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:422
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:2621
_In_ SIZE_T _Out_ PSIZE_T NewMaxQuota
Definition: mm.h:665
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:792
#define NTSTATUS
Definition: precomp.h:20
_In_ SIZE_T CurrentMaxQuota
Definition: mm.h:665
#define VOID
Definition: acefi.h:82
Definition: mm.h:373
Definition: btrfs_drv.h:1866
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:4350
NTSTATUS NTAPI MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
Definition: procsup.c:1141
SIZE_T MmTotalPagedPoolQuota
Definition: pool.c:28
VOID NTAPI MiInitBalancerThread(VOID)
Definition: balance.c:361
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:218
VOID NTAPI MmGetPageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY *SwapEntry)
Definition: page.c:299
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:422
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
Definition: mm.h:1020
#define P(row, col)
NTSTATUS ReadStatus
Definition: mm.h:380
BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Dest, IN PULONG_PTR DirectoryTableBase)
ULONG MmThrottleTop
Definition: mminit.c:396
union _MMPFN::@1753 u3
VOID NTAPI MmShowOutOfSpaceMessagePagingFile(VOID)
Definition: pagefile.c:119
HANDLE FileHandle
Definition: mm.h:509
#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
LONGLONG ViewOffset
Definition: mm.h:259
PFILE_OBJECT FileObject
Definition: mm.h:226
ULONG_PTR SIZE_T
Definition: typedefs.h:80
Definition: compat.h:694
PULONG Flags
Definition: mm.h:205
PFN_NUMBER CurrentUsage
Definition: mm.h:505
USHORT PageColor
Definition: mm.h:364
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
Definition: mm.h:1661
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
PRTL_BITMAP Bitmap
Definition: mm.h:508
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:5053
struct _MM_REGION * PMM_REGION
NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
Definition: balance.c:138
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:187
KSPIN_LOCK MmPfnLock
Definition: krnlinit.c:49
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:45
ULONG_PTR PteFrame
Definition: mm.h:418
struct _MMFREE_POOL_ENTRY * PMMFREE_POOL_ENTRY
PFN_COUNT MiUsedSwapPages
Definition: pagefile.c:52
PRTL_BITMAP EndOfPagedPoolBitmap
Definition: mm.h:487
PFN_NUMBER Total
Definition: mm.h:443
USHORT ShortFlags
Definition: mm.h:402
struct _MMPFN * PMMPFN
ULONG_PTR SWAPENTRY
Definition: mm.h:56
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI MmSetMemoryPriorityProcess(IN PEPROCESS Process, IN UCHAR MemoryPriority)
Definition: procsup.c:478
#define FORCEINLINE
Definition: wdftypes.h:67
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1700
FORCEINLINE PEPROCESS MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace)
Definition: mm.h:1646
_Must_inspect_result_ _In_ ULONG NewProtect
Definition: mmfuncs.h:682
USHORT Rom
Definition: mm.h:368
PMMPTE PteAddress
Definition: mm.h:386
#define _Out_opt_
Definition: ms_sal.h:346
_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:415
#define NULL
Definition: types.h:112
MMPTE OriginalPte
Definition: mm.h:407
struct _MM_SECTION_SEGMENT MM_SECTION_SEGMENT
VOID NTAPI MmDeleteAllRmaps(PFN_NUMBER Page, PVOID Context, VOID(*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address))
_In_ SIZE_T QuotaToReturn
Definition: mm.h:675
_Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex) VOID NTAPI MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet)
SWAPENTRY SwapEntry
Definition: mm.h:384
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
struct _MM_RMAP_ENTRY * Next
Definition: mm.h:267
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:378
enum _MI_PFN_USAGES MI_PFN_USAGES
PFN_NUMBER Blink
Definition: mm.h:389
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:2030
FAST_MUTEX Lock
Definition: mm.h:199
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
Definition: mm.h:1040
struct tagContext Context
Definition: acpixf.h:1034
SECTION_IMAGE_INFORMATION ImageInformation
Definition: mm.h:231
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:220
PFN_COUNT MiFreeSwapPages
Definition: pagefile.c:49
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY RegionListEntry
Definition: mm.h:467
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:265
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)
struct _MMPFN::@1753::@1759 e2
struct _MM_MEMORY_CONSUMER MM_MEMORY_CONSUMER
VOID NTAPI MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit)
Definition: page.c:811
_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:457
VOID NTAPI MiInitializeNonPagedPool(VOID)
Definition: pool.c:278
ULONG PagedPoolHint
Definition: mm.h:491
PVOID Address
Definition: mm.h:269
ULONG_PTR InPageError
Definition: mm.h:419
ULONG SegFlags
Definition: mm.h:216
#define MmSetCleanPage(__P, __A)
Definition: mm.h:1216
PVOID NTAPI MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node)
#define KeGetCurrentThread
Definition: hal.h:55
struct _MMPFN * NextLRU
Definition: mm.h:435
NTSTATUS NTAPI MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1526
PMMPTE FirstPteForPagedPool
Definition: mm.h:488
#define _Acquires_lock_(lock)
UCHAR MmDisablePagingExecutive
Definition: mminit.c:25
VOID NTAPI MmInitGlobalKernelPageDirectory(VOID)
Definition: page.c:277
VOID NTAPI ExpCheckPoolAllocation(PVOID P, POOL_TYPE PoolType, ULONG Tag)
Definition: expool.c:296
MMPFNLIST MmFreePageListHead
Definition: pfnlist.c:42
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
struct _MEMORY_AREA::@1750 SectionData
SINGLE_LIST_ENTRY NextStackPfn
Definition: mm.h:381
VOID NTAPI MmDeleteProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1345
__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:255
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase)
Definition: procsup.c:1115
#define APC_LEVEL
Definition: env_spec_w32.h:695
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1632
#define _IRQL_restores_
Definition: driverspecs.h:233
#define _IRQL_saves_
Definition: driverspecs.h:235
ULONG Flags
Definition: mm.h:252
PLONG64 ReferenceCount
Definition: mm.h:202
base of all file and directory entries
Definition: entries.h:82
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
Definition: mm.h:1654
ULONG_PTR NTAPI _MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, const char *file, int line)
Definition: sptab.c:266
* PKAPC_STATE
Definition: ketypes.h:1285
LONG AweReferenceCount
Definition: mm.h:408
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:490
SIZE_T MmDriverCommit
Definition: freelist.c:32
Definition: dlist.c:348
Definition: mm.h:441
union _MMPFN::@1751 u1
static KSPIN_LOCK PspQuotaLock
Definition: quota.c:18
Definition: fci.c:126
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68