ReactOS  0.4.15-dev-2124-g3bde274
mm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <internal/arch/mm.h>
4 
5 /* TYPES *********************************************************************/
6 
7 struct _EPROCESS;
8 
18 extern ULONG MmThrottleTop;
19 extern ULONG MmThrottleBottom;
20 
22 
24 
26 
30 extern PVOID KernelVerifier;
32 
35 extern SIZE_T MmSharedCommit;
36 extern SIZE_T MmDriverCommit;
37 extern SIZE_T MmProcessCommit;
41 
42 extern PVOID MiDebugMapping; // internal
43 extern PMMPTE MmDebugPte; // internal
44 
45 struct _KTRAP_FRAME;
46 struct _EPROCESS;
48 typedef ULONG_PTR SWAPENTRY;
49 
50 //
51 // MmDbgCopyMemory Flags
52 //
53 #define MMDBG_COPY_WRITE 0x00000001
54 #define MMDBG_COPY_PHYSICAL 0x00000002
55 #define MMDBG_COPY_UNSAFE 0x00000004
56 #define MMDBG_COPY_CACHED 0x00000008
57 #define MMDBG_COPY_UNCACHED 0x00000010
58 #define MMDBG_COPY_WRITE_COMBINED 0x00000020
59 
60 //
61 // Maximum chunk size per copy
62 //
63 #define MMDBG_COPY_MAX_SIZE 0x8
64 
65 #if defined(_X86_) // intenal for marea.c
66 #define MI_STATIC_MEMORY_AREAS (14)
67 #else
68 #define MI_STATIC_MEMORY_AREAS (13)
69 #endif
70 
71 #define MEMORY_AREA_SECTION_VIEW (1)
72 #ifdef NEWCC
73 #define MEMORY_AREA_CACHE (2)
74 #endif
75 #define MEMORY_AREA_OWNED_BY_ARM3 (15)
76 #define MEMORY_AREA_STATIC (0x80000000)
77 
78 /* Although Microsoft says this isn't hardcoded anymore,
79  they won't be able to change it. Stuff depends on it */
80 #define MM_VIRTMEM_GRANULARITY (64 * 1024)
81 
82 #define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
83 
84 /*
85  * Additional flags for protection attributes
86  */
87 #define PAGE_WRITETHROUGH (1024)
88 #define PAGE_SYSTEM (2048)
89 
90 #define SEC_PHYSICALMEMORY (0x80000000)
91 
92 #define MC_USER (0)
93 #define MC_SYSTEM (1)
94 #define MC_MAXIMUM (2)
95 
96 #define PAGED_POOL_MASK 1
97 #define MUST_SUCCEED_POOL_MASK 2
98 #define CACHE_ALIGNED_POOL_MASK 4
99 #define QUOTA_POOL_MASK 8
100 #define SESSION_POOL_MASK 32
101 #define VERIFIER_POOL_MASK 64
102 
103 #define MAX_PAGING_FILES (16)
104 
105 // FIXME: use ALIGN_UP_BY
106 #define MM_ROUND_UP(x,s) \
107  ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
108 
109 #define MM_ROUND_DOWN(x,s) \
110  ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
111 
112 #define PAGE_FLAGS_VALID_FOR_SECTION \
113  (PAGE_READONLY | \
114  PAGE_READWRITE | \
115  PAGE_WRITECOPY | \
116  PAGE_EXECUTE | \
117  PAGE_EXECUTE_READ | \
118  PAGE_EXECUTE_READWRITE | \
119  PAGE_EXECUTE_WRITECOPY | \
120  PAGE_NOACCESS | \
121  PAGE_NOCACHE)
122 
123 #define PAGE_IS_READABLE \
124  (PAGE_READONLY | \
125  PAGE_READWRITE | \
126  PAGE_WRITECOPY | \
127  PAGE_EXECUTE_READ | \
128  PAGE_EXECUTE_READWRITE | \
129  PAGE_EXECUTE_WRITECOPY)
130 
131 #define PAGE_IS_WRITABLE \
132  (PAGE_READWRITE | \
133  PAGE_WRITECOPY | \
134  PAGE_EXECUTE_READWRITE | \
135  PAGE_EXECUTE_WRITECOPY)
136 
137 #define PAGE_IS_EXECUTABLE \
138  (PAGE_EXECUTE | \
139  PAGE_EXECUTE_READ | \
140  PAGE_EXECUTE_READWRITE | \
141  PAGE_EXECUTE_WRITECOPY)
142 
143 #define PAGE_IS_WRITECOPY \
144  (PAGE_WRITECOPY | \
145  PAGE_EXECUTE_WRITECOPY)
146 
147 //
148 // Wait entry for marking pages that are being serviced
149 //
150 #ifdef _M_IX86
151 #define MM_WAIT_ENTRY 0x7ffffc00
152 #elif defined(_M_AMD64)
153 #define MM_WAIT_ENTRY 0x7FFFFFFFFFFFFC00ULL
154 #else
155 #error Unsupported architecture!
156 #endif
157 
158 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
159  InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
160 
161 #define InterlockedExchangePte(PointerPte, Value) \
162  InterlockedExchange((PLONG)(PointerPte), Value)
163 
164 typedef struct _MM_SECTION_SEGMENT
165 {
167 
168  FAST_MUTEX Lock; /* lock which protects the page directory */
169  LARGE_INTEGER RawLength; /* length of the segment which is part of the mapped file */
170  LARGE_INTEGER Length; /* absolute length of the segment */
177 
178  struct
179  {
180  ULONGLONG FileOffset; /* start offset into the file for image sections */
181  ULONG_PTR VirtualAddress; /* start offset into the address range for image sections */
183  } Image;
184 
187 
189 
192 
194 {
196 
199 
205 
206 #define MM_PHYSICALMEMORY_SEGMENT (0x1)
207 #define MM_DATAFILE_SEGMENT (0x2)
208 #define MM_SEGMENT_INDELETE (0x4)
209 #define MM_SEGMENT_INCREATE (0x8)
210 
211 
212 #define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn << PAGE_SHIFT)
213 #define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 1) << PAGE_SHIFT)
214 
215 typedef struct _MEMORY_AREA
216 {
218 
224 
225  struct
226  {
230  } SectionData;
232 
233 typedef struct _MM_RMAP_ENTRY
234 {
238 #if DBG
239  PVOID Caller;
240 #endif
241 }
243 
244 #if MI_TRACE_PFNS
247 #define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
248 #define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, 16)
249 #else
250 #define MI_SET_USAGE(x)
251 #define MI_SET_PROCESS2(x)
252 #endif
253 
254 typedef enum _MI_PFN_USAGES
255 {
279 } MI_PFN_USAGES;
280 
281 //
282 // These two mappings are actually used by Windows itself, based on the ASSERTS
283 //
284 #define StartOfAllocation ReadInProgress
285 #define EndOfAllocation WriteInProgress
286 
287 typedef struct _MMPFNENTRY
288 {
290  USHORT ReadInProgress:1; // StartOfAllocation
291  USHORT WriteInProgress:1; // EndOfAllocation
299 } MMPFNENTRY;
300 
301 // Mm internal
302 typedef struct _MMPFN
303 {
304  union
305  {
311 
312  // HACK for ROSPFN
314  } u1;
316  union
317  {
320  } u2;
321  union
322  {
323  struct
324  {
327  };
328  struct
329  {
332  } e2;
333  } u3;
334  union
335  {
338 
339  // HACK for ROSPFN
341  };
342  union
343  {
345  struct
346  {
353  };
354  } u4;
355 #if MI_TRACE_PFNS
356  MI_PFN_USAGES PfnUsage;
357  CHAR ProcessName[16];
358 #endif
359 
360  // HACK until WS lists are supported
362  struct _MMPFN* NextLRU;
364 } MMPFN, *PMMPFN;
365 
366 extern PMMPFN MmPfnDatabase;
367 
368 typedef struct _MMPFNLIST
369 {
375 
381 
382 typedef struct _MM_MEMORY_CONSUMER
383 {
388 
389 typedef struct _MM_REGION
390 {
396 
397 // Mm internal
398 /* Entry describing free pool memory */
399 typedef struct _MMFREE_POOL_ENTRY
400 {
406 
407 /* Signature of a freed block */
408 #define MM_FREE_POOL_SIGNATURE 'ARM3'
409 
410 /* Paged pool information */
411 typedef struct _MM_PAGED_POOL_INFO
412 {
422 
424 
425 /* Page file information */
426 typedef struct _MMPAGING_FILE
427 {
437 }
439 
441 
442 typedef VOID
446  SIZE_T Length,
447  ULONG OldType,
448  ULONG OldProtect,
449  ULONG NewType,
451 );
452 
453 typedef VOID
455  PVOID Context,
457  PVOID Address,
459  SWAPENTRY SwapEntry,
460  BOOLEAN Dirty
461 );
462 
463 //
464 // Mm copy support for Kd
465 //
466 NTSTATUS
467 NTAPI
470  IN PVOID Buffer,
471  IN ULONG Size,
472  IN ULONG Flags
473 );
474 
475 //
476 // Determines if a given address is a session address
477 //
478 BOOLEAN
479 NTAPI
482 );
483 
484 ULONG
485 NTAPI
488 );
489 
490 ULONG
491 NTAPI
494 );
495 
496 /* marea.c *******************************************************************/
497 
498 NTSTATUS
499 NTAPI
502  ULONG Type,
504  SIZE_T Length,
505  ULONG Protection,
507  ULONG AllocationFlags,
508  ULONG AllocationGranularity
509 );
510 
512 NTAPI
515  PVOID Address
516 );
517 
518 NTSTATUS
519 NTAPI
524  PVOID FreePageContext
525 );
526 
527 VOID
528 NTAPI
531  PMMVAD Vad);
532 
534 NTAPI
537  PVOID Address,
538  SIZE_T Length
539 );
540 
541 PVOID
542 NTAPI
543 MmFindGap(
545  SIZE_T Length,
546  ULONG_PTR Granularity,
547  BOOLEAN TopDown
548 );
549 
550 VOID
551 NTAPI
554 
555 VOID
556 NTAPI
558 
559 /* npool.c *******************************************************************/
560 
561 VOID
562 NTAPI
564 
565 PVOID
566 NTAPI
569  IN SIZE_T SizeInBytes
570 );
571 
572 POOL_TYPE
573 NTAPI
576 );
577 
578 ULONG
579 NTAPI
581  IN PVOID StartingAddress
582 );
583 
584 /* pool.c *******************************************************************/
585 
586 BOOLEAN
587 NTAPI
590  IN ULONG CurrentMaxQuota,
591  OUT PULONG NewMaxQuota
592 );
593 
594 /* mdl.c *********************************************************************/
595 
596 VOID
597 NTAPI
599  PMDL Mdl,
600  PPFN_NUMBER Pages
601 );
602 
603 /* mminit.c ******************************************************************/
604 
605 VOID
606 NTAPI
607 MmInit1(
608  VOID
609 );
610 
611 BOOLEAN
612 NTAPI
613 MmInitSystem(IN ULONG Phase,
614  IN PLOADER_PARAMETER_BLOCK LoaderBlock);
615 
616 
617 /* pagefile.c ****************************************************************/
618 
619 SWAPENTRY
620 NTAPI
622 
623 VOID
624 NTAPI
626 
627 VOID
628 NTAPI
630 
631 BOOLEAN
632 NTAPI
634 
635 NTSTATUS
636 NTAPI
638  SWAPENTRY SwapEntry,
640 );
641 
642 NTSTATUS
643 NTAPI
645  SWAPENTRY SwapEntry,
647 );
648 
649 VOID
650 NTAPI
652 
653 NTSTATUS
654 NTAPI
657  _In_ ULONG PageFileIndex,
658  _In_ ULONG_PTR PageFileOffset);
659 
660 /* process.c ****************************************************************/
661 
662 NTSTATUS
663 NTAPI
666  IN PEPROCESS Clone OPTIONAL,
667  IN PVOID Section OPTIONAL,
668  IN OUT PULONG Flags,
670 );
671 
672 NTSTATUS
673 NTAPI
676  IN PINITIAL_PEB InitialPeb,
677  OUT PPEB *BasePeb
678 );
679 
680 NTSTATUS
681 NTAPI
685  IN PINITIAL_TEB InitialTeb,
686  OUT PTEB* BaseTeb
687 );
688 
689 VOID
690 NTAPI
692  struct _EPROCESS *Process,
693  PTEB Teb
694 );
695 
696 VOID
697 NTAPI
699 
700 NTSTATUS
701 NTAPI
703 
704 ULONG
705 NTAPI
707 
708 NTSTATUS
709 NTAPI
712  IN UCHAR MemoryPriority
713 );
714 
715 /* i386/pfault.c *************************************************************/
716 
717 NTSTATUS
718 NTAPI
720  ULONG Cs,
721  PULONG Eip,
722  PULONG Eax,
723  ULONG Cr2,
725 );
726 
727 /* special.c *****************************************************************/
728 
729 VOID
730 NTAPI
732 
733 BOOLEAN
734 NTAPI
737  IN ULONG Tag);
738 
739 BOOLEAN
740 NTAPI
742  IN PVOID P);
743 
744 BOOLEAN
745 NTAPI
747  IN PVOID P);
748 
749 PVOID
750 NTAPI
753  IN ULONG Tag,
755  IN ULONG SpecialType);
756 
757 VOID
758 NTAPI
760  IN PVOID P);
761 
762 /* mm.c **********************************************************************/
763 
764 NTSTATUS
765 NTAPI
767  IN ULONG FaultCode,
768  IN PVOID Address,
770  IN PVOID TrapInformation
771 );
772 
773 /* process.c *****************************************************************/
774 
775 PVOID
776 NTAPI
778 
779 VOID
780 NTAPI
782  BOOLEAN GuiStack);
783 
784 /* balance.c *****************************************************************/
785 
786 VOID
787 NTAPI
789  ULONG Consumer,
790  NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
791 );
792 
793 VOID
794 NTAPI
796  ULONG NrAvailablePages,
797  ULONG NrSystemPages
798 );
799 
800 NTSTATUS
801 NTAPI
803  ULONG Consumer,
805 );
806 
807 NTSTATUS
808 NTAPI
810  ULONG Consumer,
811  BOOLEAN MyWait,
812  PPFN_NUMBER AllocatedPage
813 );
814 
815 VOID
816 NTAPI
818 
819 VOID
820 NTAPI
822 
823 /* rmap.c **************************************************************/
824 #define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff)
825 #define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
826 
827 VOID
828 NTAPI
831  struct _MM_RMAP_ENTRY* ListHead
832 );
833 
834 struct _MM_RMAP_ENTRY*
835 NTAPI
837 
838 VOID
839 NTAPI
842  struct _EPROCESS *Process,
843  PVOID Address
844 );
845 
846 VOID
847 NTAPI
850  PVOID Context,
851  VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
852 );
853 
854 VOID
855 NTAPI
858  struct _EPROCESS *Process,
859  PVOID Address
860 );
861 
862 VOID
863 NTAPI
865 
866 VOID
867 NTAPI
869 BOOLEAN
870 NTAPI
872 
873 NTSTATUS
874 NTAPI
876 
878 NTAPI
881 
882 /* freelist.c **********************************************************/
883 
885 KIRQL
887 {
889 }
890 
892 VOID
895 {
897 }
898 
900 VOID
902 {
903  PKSPIN_LOCK_QUEUE LockQueue;
904 
906  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
908 }
909 
911 VOID
913 {
914  PKSPIN_LOCK_QUEUE LockQueue;
915 
916  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
919 }
920 
921 #define MI_ASSERT_PFN_LOCK_HELD() ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL)
922 
924 PMMPFN
926 {
927  PMMPFN Page;
928  extern RTL_BITMAP MiPfnBitMap;
929 
930  /* Make sure the PFN number is valid */
931  if (Pfn > MmHighestPhysicalPage) return NULL;
932 
933  /* Make sure this page actually has a PFN entry */
934  if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL;
935 
936  /* Get the entry */
937  Page = &MmPfnDatabase[Pfn];
938 
939  /* Return it */
940  return Page;
941 };
942 
946 {
947  //
948  // This will return the Page Frame Number (PFN) from the MMPFN
949  //
950  return Pfn1 - MmPfnDatabase;
951 }
952 
954 NTAPI
955 MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast);
956 
958 NTAPI
960 
961 VOID
962 NTAPI
964  IN BOOLEAN StatusOnly
965 );
966 
967 VOID
968 NTAPI
970  VOID
971 );
972 
973 /* hypermap.c *****************************************************************/
974 PVOID
975 NTAPI
978  IN PKIRQL OldIrql);
979 
980 VOID
981 NTAPI
983  IN PVOID Address,
984  IN KIRQL OldIrql);
985 
986 PVOID
987 NTAPI
989  IN PFN_NUMBER NumberOfPages);
990 
991 VOID
992 NTAPI
994  IN PFN_NUMBER NumberOfPages);
995 
996 /* i386/page.c *********************************************************/
997 
998 NTSTATUS
999 NTAPI
1001  struct _EPROCESS* Process,
1002  PVOID Address,
1003  ULONG flProtect,
1004  PPFN_NUMBER Pages,
1005  ULONG PageCount
1006 );
1007 
1008 NTSTATUS
1009 NTAPI
1011  struct _EPROCESS* Process,
1012  PVOID Address,
1013  ULONG flProtect,
1014  PPFN_NUMBER Pages,
1015  ULONG PageCount
1016 );
1017 
1018 ULONG
1019 NTAPI
1021  struct _EPROCESS* Process,
1022  PVOID Address);
1023 
1024 VOID
1025 NTAPI
1027  struct _EPROCESS* Process,
1028  PVOID Address,
1029  ULONG flProtect
1030 );
1031 
1032 BOOLEAN
1033 NTAPI
1035  struct _EPROCESS* Process,
1036  PVOID Address
1037 );
1038 
1039 BOOLEAN
1040 NTAPI
1042  struct _EPROCESS* Process,
1043  PVOID Address
1044 );
1045 
1046 VOID
1047 NTAPI
1049 
1050 VOID
1051 NTAPI
1053  struct _EPROCESS *Process,
1054  PVOID Address,
1055  SWAPENTRY* SwapEntry);
1056 
1057 VOID
1058 NTAPI
1060  struct _EPROCESS *Process,
1061  PVOID Address,
1062  SWAPENTRY* SwapEntry
1063 );
1064 
1065 NTSTATUS
1066 NTAPI
1068  struct _EPROCESS *Process,
1069  PVOID Address,
1070  SWAPENTRY SwapEntry
1071 );
1072 
1073 BOOLEAN
1074 NTAPI
1076  struct _EPROCESS *Process,
1077  PVOID Address
1078 );
1079 
1080 VOID
1081 NTAPI
1083  struct _EPROCESS *Process,
1084  PVOID Address
1085 );
1086 
1087 PFN_NUMBER
1088 NTAPI
1089 MmAllocPage(
1090  ULONG Consumer
1091 );
1092 
1093 VOID
1094 NTAPI
1096 
1097 VOID
1098 NTAPI
1100 
1101 ULONG
1102 NTAPI
1104 
1105 BOOLEAN
1106 NTAPI
1108 
1109 VOID
1110 NTAPI
1112  PFN_NUMBER Page,
1113  SWAPENTRY SavedSwapEntry);
1114 
1115 SWAPENTRY
1116 NTAPI
1118 
1119 VOID
1120 NTAPI
1122  struct _EPROCESS *Process,
1123  PVOID Address
1124 );
1125 
1126 VOID
1127 NTAPI
1129  struct _EPROCESS *Process,
1130  PVOID Address
1131 );
1132 
1133 PFN_NUMBER
1134 NTAPI
1136  struct _EPROCESS *Process,
1137  PVOID Address
1138 );
1139 
1140 BOOLEAN
1141 NTAPI
1143  IN ULONG MinWs,
1144  IN PEPROCESS Dest,
1145  IN PULONG_PTR DirectoryTableBase
1146 );
1147 
1148 NTSTATUS
1149 NTAPI
1152  IN PULONG_PTR DirectoryTableBase
1153 );
1154 
1155 NTSTATUS
1156 NTAPI
1159 );
1160 
1161 NTSTATUS
1162 NTAPI
1163 MmSetExecuteOptions(IN ULONG ExecuteOptions);
1164 
1165 NTSTATUS
1166 NTAPI
1167 MmGetExecuteOptions(IN PULONG ExecuteOptions);
1168 
1169 VOID
1170 NTAPI
1172  struct _EPROCESS *Process,
1173  PVOID Address,
1174  BOOLEAN* WasDirty,
1176 );
1177 
1178 BOOLEAN
1179 NTAPI
1181  struct _EPROCESS *Process,
1182  PVOID Address
1183 );
1184 
1185 VOID
1186 NTAPI
1188 
1189 BOOLEAN
1190 NTAPI
1192 
1193 /* wset.c ********************************************************************/
1194 
1195 NTSTATUS
1197  ULONG Target,
1198  ULONG Priority,
1199  PULONG NrFreedPages
1200 );
1201 
1202 /* region.c ************************************************************/
1203 
1204 NTSTATUS
1205 NTAPI
1209  PLIST_ENTRY RegionListHead,
1210  PVOID StartAddress,
1211  SIZE_T Length,
1212  ULONG NewType,
1213  ULONG NewProtect,
1214  PMM_ALTER_REGION_FUNC AlterFunc
1215 );
1216 
1217 VOID
1218 NTAPI
1220  PLIST_ENTRY RegionListHead,
1221  SIZE_T Length,
1222  ULONG Type,
1223  ULONG Protect
1224 );
1225 
1226 PMM_REGION
1227 NTAPI
1228 MmFindRegion(
1230  PLIST_ENTRY RegionListHead,
1231  PVOID Address,
1232  PVOID* RegionBaseAddress
1233 );
1234 
1235 /* section.c *****************************************************************/
1236 
1237 #define PFN_FROM_SSE(E) ((PFN_NUMBER)((E) >> PAGE_SHIFT))
1238 #define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
1239 #define MM_IS_WAIT_PTE(E) \
1240  (IS_SWAP_FROM_SSE(E) && SWAPENTRY_FROM_SSE(E) == MM_WAIT_ENTRY)
1241 #define MAKE_PFN_SSE(P) ((ULONG_PTR)((P) << PAGE_SHIFT))
1242 #define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
1243 #define MAKE_SWAP_SSE(S) (((ULONG_PTR)(S) << 1) | 0x1)
1244 #define DIRTY_SSE(E) ((E) | 2)
1245 #define CLEAN_SSE(E) ((E) & ~2)
1246 #define IS_DIRTY_SSE(E) ((E) & 2)
1247 #define WRITE_SSE(E) ((E) | 4)
1248 #define IS_WRITE_SSE(E) ((E) & 4)
1249 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
1250 #define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
1251 #define MAX_SHARE_COUNT 0x1FF
1252 #define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
1253 #define BUMPREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) + 1) << 3) | ((E) & 0x7))
1254 #define DECREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) - 1) << 3) | ((E) & 0x7))
1255 
1256 VOID
1257 NTAPI
1259  const char *file,
1260  int line);
1261 
1262 #define MmLockSectionSegment(x) _MmLockSectionSegment(x,__FILE__,__LINE__)
1263 
1264 VOID
1265 NTAPI
1267  const char *file,
1268  int line);
1269 
1270 #define MmUnlockSectionSegment(x) _MmUnlockSectionSegment(x,__FILE__,__LINE__)
1271 
1272 VOID
1273 NTAPI
1275  OUT PSECTION_IMAGE_INFORMATION ImageInformation
1276 );
1277 
1279 NTAPI
1281  IN PVOID Section
1282 );
1283 NTSTATUS
1284 NTAPI
1286  IN PVOID Address,
1288 );
1289 
1290 NTSTATUS
1291 NTAPI
1293  IN PVOID Section,
1295 );
1296 
1297 NTSTATUS
1298 NTAPI
1301  PVOID Address,
1304 );
1305 
1306 NTSTATUS
1307 NTAPI
1312  SIZE_T Length,
1313  ULONG Protect,
1314  PULONG OldProtect
1315 );
1316 
1317 NTSTATUS
1318 NTAPI
1320 
1321 NTSTATUS
1322 NTAPI
1326  PVOID Address,
1327  BOOLEAN Locked
1328 );
1329 
1330 NTSTATUS
1331 NTAPI
1333 
1334 NTSTATUS
1335 NTAPI
1339  PVOID Address
1340 );
1341 
1342 VOID
1343 NTAPI
1345 
1346 /* Exported from NT 6.2 Onward. We keep it internal. */
1347 NTSTATUS
1348 NTAPI
1350  _In_ PVOID Section,
1355  );
1356 
1357 BOOLEAN
1358 NTAPI
1362  _In_ ULONG Length);
1363 
1364 NTSTATUS
1365 NTAPI
1368  _In_ PVOID Address,
1369  _In_ ULONG Length);
1370 
1371 NTSTATUS
1372 NTAPI
1378 
1379 NTSTATUS
1380 NTAPI
1384  _In_ ULONG Length,
1386 
1387 NTSTATUS
1388 NTAPI
1392  _In_ ULONG Length,
1393  _In_ PLARGE_INTEGER ValidDataLength);
1394 
1395 BOOLEAN
1396 NTAPI
1400  _In_ ULONG Length);
1401 
1402 BOOLEAN
1403 NTAPI
1408  BOOLEAN PageOut);
1409 
1410 BOOLEAN
1411 NTAPI
1415  BOOLEAN Dirty,
1416  BOOLEAN PageOut,
1417  ULONG_PTR *InEntry);
1418 
1419 VOID
1420 NTAPI
1422 
1423 NTSTATUS
1424 NTAPI
1426  _In_ PVOID Section,
1428 
1429 /* sptab.c *******************************************************************/
1430 
1431 NTSTATUS
1432 NTAPI
1435  ULONG_PTR Entry,
1436  const char *file,
1437  int line);
1438 
1439 ULONG_PTR
1440 NTAPI
1443  const char *file,
1444  int line);
1445 
1446 #define MmSetPageEntrySectionSegment(S,O,E) _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__)
1447 
1448 #define MmGetPageEntrySectionSegment(S,O) _MmGetPageEntrySectionSegment(S,O,__FILE__,__LINE__)
1449 
1450 /* sysldr.c ******************************************************************/
1451 
1452 VOID
1453 NTAPI
1455  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1456 );
1457 
1458 BOOLEAN
1459 NTAPI
1461  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1462 );
1463 
1464 BOOLEAN
1465 NTAPI
1467 
1468 VOID
1469 NTAPI
1471 
1472 NTSTATUS
1473 NTAPI
1476  IN PUNICODE_STRING NamePrefix OPTIONAL,
1477  IN PUNICODE_STRING LoadedName OPTIONAL,
1478  IN ULONG Flags,
1479  OUT PVOID *ModuleObject,
1480  OUT PVOID *ImageBaseAddress
1481 );
1482 
1483 NTSTATUS
1484 NTAPI
1486  IN PVOID ImageHandle
1487 );
1488 
1489 NTSTATUS
1490 NTAPI
1492  IN HANDLE ImageHandle,
1493  IN BOOLEAN PurgeSection
1494 );
1495 
1496 NTSTATUS
1497 NTAPI
1499  IN PLDR_DATA_TABLE_ENTRY LdrEntry,
1500  IN PLIST_ENTRY ListHead
1501 );
1502 
1503 VOID
1504 NTAPI
1506  IN PLDR_DATA_TABLE_ENTRY LdrEntry);
1507 
1508 /* procsup.c *****************************************************************/
1509 
1510 NTSTATUS
1511 NTAPI
1513  IN PVOID StackPointer
1514 );
1515 
1516 
1518 VOID
1520 {
1521  KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1522 }
1523 
1525 VOID
1527 {
1528  KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1529 }
1530 
1532 PEPROCESS
1534 {
1535  if (AddressSpace == MmKernelAddressSpace) return NULL;
1537 }
1538 
1540 PMMSUPPORT
1542 {
1543  return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->Vm;
1544 }
1545 
1547 PMMSUPPORT
1549 {
1550  return MmKernelAddressSpace;
1551 }
1552 
1553 
1554 /* expool.c ******************************************************************/
1555 
1556 VOID
1557 NTAPI
1559  PVOID P,
1561  ULONG Tag);
1562 
1563 VOID
1564 NTAPI
1566  IN PVOID P);
1567 
1568 
1569 /* mmsup.c *****************************************************************/
1570 
1571 NTSTATUS
1572 NTAPI
1574  IN SIZE_T WorkingSetMinimumInBytes,
1575  IN SIZE_T WorkingSetMaximumInBytes,
1576  IN ULONG SystemCache,
1577  IN BOOLEAN IncreaseOkay);
1578 
1579 
1580 /* session.c *****************************************************************/
1581 
1583 NTSTATUS
1584 NTAPI
1585 MmAttachSession(
1586  _Inout_ PVOID SessionEntry,
1588 
1590 VOID
1591 NTAPI
1592 MmDetachSession(
1593  _Inout_ PVOID SessionEntry,
1595 
1596 VOID
1597 NTAPI
1599  _Inout_ PVOID SessionEntry);
1600 
1601 PVOID
1602 NTAPI
1604  _In_ ULONG SessionId);
1605 
1607 VOID
1608 NTAPI
1609 MmSetSessionLocaleId(
1610  _In_ LCID LocaleId);
1611 
1612 /* shutdown.c *****************************************************************/
1613 
1614 VOID
1615 MmShutdownSystem(IN ULONG Phase);
1616 
1617 /* virtual.c *****************************************************************/
1618 
1619 NTSTATUS
1620 NTAPI
1621 MmCopyVirtualMemory(IN PEPROCESS SourceProcess,
1623  IN PEPROCESS TargetProcess,
1627  OUT PSIZE_T ReturnSize);
1628 
VOID NTAPI MmDereferencePage(PFN_NUMBER Page)
Definition: freelist.c:566
VOID NTAPI MmSetCleanAllRmaps(PFN_NUMBER Page)
Definition: rmap.c:297
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
NTSTATUS NTAPI MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address)
Definition: section.c:1900
NTSTATUS NTAPI MmExtendSection(_In_ PVOID Section, _Inout_ PLARGE_INTEGER NewSize)
Definition: section.c:5046
VOID FASTCALL KeReleaseQueuedSpinLockFromDpcLevel(IN OUT PKSPIN_LOCK_QUEUE LockQueue)
PRTL_BITMAP PagedPoolAllocationMap
Definition: mm.h:413
PULONG Buffer
Definition: typedefs.h:91
ULONG_PTR VirtualAddress
Definition: mm.h:181
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:1733
BOOLEAN WriteCopy
Definition: mm.h:175
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:1636
PEPROCESS Process
Definition: mm.h:236
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:443
VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject)
ULONG Type
Definition: mm.h:219
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:182
Definition: ntbasedef.h:628
NTSTATUS NTAPI MmAccessFault(IN ULONG FaultCode, IN PVOID Address, IN KPROCESSOR_MODE Mode, IN PVOID TrapInformation)
Definition: mmfault.c:204
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:1860
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PPFN_NUMBER Pages, ULONG PageCount)
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:290
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:4728
VOID NTAPI MmDumpArmPfnDatabase(IN BOOLEAN StatusOnly)
Definition: mminit.c:1474
BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: sysldr.c:2205
ULONG_PTR AweAllocation
Definition: mm.h:350
ULONG Signature
Definition: mm.h:403
ULONG PagesTarget
Definition: mm.h:385
struct _MM_SECTION_SEGMENT::@1774 Image
struct _MMPFN::@1778::@1784 e2
VOID NTAPI MmDeleteRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
_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:371
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1526
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:4508
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion(PMMSUPPORT AddressSpace, PVOID Address, SIZE_T Length)
Definition: marea.c:106
PMM_RMAP_ENTRY RmapListHead
Definition: mm.h:340
struct _MM_PAGED_POOL_INFO MM_PAGED_POOL_INFO
NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID)
Definition: section.c:2160
Definition: mm.h:389
ULONG SectionCount
Definition: mm.h:172
struct _MM_RMAP_ENTRY MM_RMAP_ENTRY
LONG NTSTATUS
Definition: precomp.h:26
PFN_NUMBER Size
Definition: mm.h:428
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:1054
BOOLEAN NTAPI MmIsSessionAddress(IN PVOID Address)
Definition: session.c:49
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1075
PFN_NUMBER Flink
Definition: mm.h:306
struct _EPROCESS * PEPROCESS
Definition: nt_native.h:30
LIST_ENTRY RegionListHead
Definition: mm.h:229
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
Definition: balance.c:77
SIZE_T MmSharedCommit
Definition: freelist.c:31
BOOLEAN NTAPI MmIsDirtyPageRmap(PFN_NUMBER Page)
Definition: rmap.c:320
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:275
FORCEINLINE KIRQL MiAcquirePfnLock(VOID)
Definition: mm.h:886
VOID(* PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
Definition: mm.h:454
USHORT Modified
Definition: mm.h:289
PMM_SECTION_SEGMENT Segment
Definition: mm.h:228
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:295
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:4636
DWORD LCID
Definition: nls.h:13
PFILE_OBJECT FileObject
Definition: mm.h:433
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:1881
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:530
union _MMPFN::@1781 u4
USHORT ReferenceCount
Definition: mm.h:325
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:893
union _MMPFN::@1778 u3
USHORT PageLocation
Definition: mm.h:294
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:372
enum _MMLISTS MMLISTS
FORCEINLINE VOID MiReleasePfnLockFromDpcLevel(VOID)
Definition: mm.h:912
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:2325
FORCEINLINE VOID MiAcquirePfnLockAtDpcLevel(VOID)
Definition: mm.h:901
MMWSLE Wsle
Definition: mm.h:361
_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:292
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
UCHAR KIRQL
Definition: env_spec_w32.h:591
MMPFNENTRY e1
Definition: mm.h:326
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG Magic
Definition: mm.h:222
NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, PSIZE_T ResultLength)
Definition: section.c:2063
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:296
PLARGE_INTEGER BOOLEAN ForceDirty
Definition: section.c:4837
#define MC_MAXIMUM
Definition: mm.h:94
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:1807
ULONG_PTR MustBeCached
Definition: mm.h:352
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
VOID NTAPI MmSetDirtyPage(struct _EPROCESS *Process, PVOID Address)
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:2251
PMMPTE LastPteForPagedPool
Definition: mm.h:416
ULONG Type
Definition: mm.h:391
struct _MM_MEMORY_CONSUMER * PMM_MEMORY_CONSUMER
struct _MMPFNLIST * PMMPFNLIST
ULONG_PTR ShareCount
Definition: mm.h:319
SIZE_T MmTotalCommitLimit
Definition: mminit.c:359
NTSTATUS NTAPI MmCallDllInitialize(IN PLDR_DATA_TABLE_ENTRY LdrEntry, IN PLIST_ENTRY ListHead)
Definition: sysldr.c:309
ULONG Protection
Definition: mm.h:173
VOID NTAPI MmRebalanceMemoryConsumers(VOID)
Definition: balance.c:265
long LONG
Definition: pedump.c:60
USHORT ParityError
Definition: mm.h:298
ULONG NTAPI MmGetSessionLocaleId(VOID)
Definition: session.c:57
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:217
PFN_NUMBER Blink
Definition: mm.h:373
PKEVENT Event
Definition: mm.h:308
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
Definition: sysldr.c:2294
PMMSUPPORT MmKernelAddressSpace
Definition: mminit.c:27
struct _MM_RMAP_ENTRY * PMM_RMAP_ENTRY
LIST_ENTRY List
Definition: mm.h:401
_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 MmGetExecuteOptions(IN PULONG ExecuteOptions)
Definition: pagfault.c:2522
BOOLEAN Locked
Definition: mm.h:176
VOID NTAPI MmSetCleanPage(struct _EPROCESS *Process, PVOID Address)
unsigned char BOOLEAN
SIZE_T AllocatedPagedPool
Definition: mm.h:420
SIZE_T MmPeakCommitment
Definition: freelist.c:35
static WCHAR Address[46]
Definition: ping.c:68
VOID NTAPI MmDeleteVirtualMapping(struct _EPROCESS *Process, PVOID Address, BOOLEAN *WasDirty, PPFN_NUMBER Page)
ULONG_PTR VerifierAllocation
Definition: mm.h:349
SIZE_T Length
Definition: mm.h:393
_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
VOID NTAPI MmClearPageAccessedBit(PEPROCESS Process, PVOID Address)
Definition: page.c:590
PFN_NUMBER Page
Definition: section.c:4843
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:363
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
VOID NTAPI MmGetPageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
VOID NTAPI MmQuitNextSession(_Inout_ PVOID SessionEntry)
Definition: session.c:1034
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
Definition: procsup.c:459
SIZE_T PagedPoolCommit
Definition: mm.h:419
PFN_NUMBER MaximumSize
Definition: mm.h:429
PFN_NUMBER MinimumSize
Definition: mm.h:430
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:166
UNICODE_STRING PageFileName
Definition: mm.h:434
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
BOOLEAN NTAPI MmIsPageAccessed(PEPROCESS Process, PVOID Address)
Definition: page.c:623
_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:392
USHORT WriteInProgress
Definition: mm.h:291
NTSTATUS NTAPI MmCheckSystemImage(IN HANDLE ImageHandle, IN BOOLEAN PurgeSection)
Definition: sysldr.c:2706
NTSTATUS NTAPI MmUnloadSystemImage(IN PVOID ImageHandle)
Definition: sysldr.c:912
NTSTATUS NTAPI MmPageFault(ULONG Cs, PULONG Eip, PULONG Eax, ULONG Cr2, ULONG ErrorCode)
LARGE_INTEGER Length
Definition: mm.h:170
PMMPTE MmDebugPte
Definition: mmdbg.c:31
ULONGLONG FileOffset
Definition: mm.h:180
FAST_MUTEX
Definition: extypes.h:17
BOOLEAN NTAPI MmIsSpecialPoolAddressFree(IN PVOID P)
PFN_COUNT Size
Definition: mm.h:402
int64_t LONGLONG
Definition: typedefs.h:68
VOID NTAPI MmCleanProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1323
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:254
LONG64 RefCount
Definition: mm.h:185
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:431
struct _MMPFNLIST MMPFNLIST
#define MAX_PAGING_FILES
Definition: mm.h:103
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:399
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:386
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:203
PLARGE_INTEGER BOOLEAN BOOLEAN PageOut
Definition: section.c:4840
struct _MMPAGING_FILE MMPAGING_FILE
BOOLEAN DeleteInProgress
Definition: mm.h:221
BOOLEAN NTAPI MmIsDisabledPage(struct _EPROCESS *Process, PVOID Address)
LARGE_INTEGER RawLength
Definition: mm.h:169
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:1798
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:1995
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:419
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Page)
Definition: freelist.c:538
struct _MM_SECTION_SEGMENT * PMM_SECTION_SEGMENT
MMVAD VadNode
Definition: mm.h:217
LIST_ENTRY MmLoadedUserImageList
Definition: sysldr.c:35
struct _MMFREE_POOL_ENTRY * Owner
Definition: mm.h:404
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:905
struct _MM_REGION MM_REGION
NTSTATUS NTAPI MmSetExecuteOptions(IN ULONG ExecuteOptions)
Definition: pagfault.c:2564
_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:302
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:4196
NTSTATUS NTAPI MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
Definition: procsup.c:1146
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:188
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:351
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
Definition: mm.h:925
#define P(row, col)
NTSTATUS ReadStatus
Definition: mm.h:309
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:436
#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:227
NTSTATUS NTAPI MmCreateVirtualMappingUnsafe(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PPFN_NUMBER Pages, ULONG PageCount)
PFILE_OBJECT FileObject
Definition: mm.h:195
ULONG_PTR SIZE_T
Definition: typedefs.h:80
Definition: compat.h:694
PULONG Flags
Definition: mm.h:174
PFN_NUMBER CurrentUsage
Definition: mm.h:432
USHORT PageColor
Definition: mm.h:293
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
Definition: mm.h:1548
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
PRTL_BITMAP Bitmap
Definition: mm.h:435
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:4975
struct _MM_REGION * PMM_REGION
NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
Definition: balance.c:136
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:347
struct _MMFREE_POOL_ENTRY * PMMFREE_POOL_ENTRY
PFN_COUNT MiUsedSwapPages
Definition: pagefile.c:52
PRTL_BITMAP EndOfPagedPoolBitmap
Definition: mm.h:414
PFN_NUMBER Total
Definition: mm.h:370
USHORT ShortFlags
Definition: mm.h:331
struct _MMPFN * PMMPFN
ULONG_PTR SWAPENTRY
Definition: mm.h:47
#define FORCEINLINE
Definition: wdftypes.h:67
NTSTATUS NTAPI MmSetMemoryPriorityProcess(IN PEPROCESS Process, IN UCHAR MemoryPriority)
Definition: procsup.c:469
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1587
FORCEINLINE PEPROCESS MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace)
Definition: mm.h:1533
_Must_inspect_result_ _In_ ULONG NewProtect
Definition: mmfuncs.h:682
USHORT Rom
Definition: mm.h:297
PMMPTE PteAddress
Definition: mm.h:315
_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:344
#define NULL
Definition: types.h:112
MMPTE OriginalPte
Definition: mm.h:336
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
SWAPENTRY SwapEntry
Definition: mm.h:313
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
struct _MM_RMAP_ENTRY * Next
Definition: mm.h:235
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:1694
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:307
enum _MI_PFN_USAGES MI_PFN_USAGES
FORCEINLINE VOID MmInitGlobalKernelPageDirectory(VOID)
Definition: mm.h:300
PFN_NUMBER Blink
Definition: mm.h:318
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:2027
FAST_MUTEX Lock
Definition: mm.h:168
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
Definition: mm.h:945
struct tagContext Context
Definition: acpixf.h:1034
SECTION_IMAGE_INFORMATION ImageInformation
Definition: mm.h:200
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:190
PFN_COUNT MiFreeSwapPages
Definition: pagefile.c:49
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY RegionListEntry
Definition: mm.h:394
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:233
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:180
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
_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:384
VOID NTAPI MiInitializeNonPagedPool(VOID)
Definition: pool.c:276
ULONG PagedPoolHint
Definition: mm.h:418
PVOID Address
Definition: mm.h:237
ULONG_PTR InPageError
Definition: mm.h:348
ULONG SegFlags
Definition: mm.h:186
BOOLEAN NTAPI MiRaisePoolQuota(IN POOL_TYPE PoolType, IN ULONG CurrentMaxQuota, OUT PULONG NewMaxQuota)
Definition: pool.c:1266
PVOID NTAPI MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node)
#define KeGetCurrentThread
Definition: hal.h:44
struct _MMPFN * NextLRU
Definition: mm.h:362
NTSTATUS NTAPI MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1507
PMMPTE FirstPteForPagedPool
Definition: mm.h:415
NTSTATUS NTAPI MmRosFlushVirtualMemory(_In_ PEPROCESS Process, _Inout_ PVOID *Address, _Inout_ PSIZE_T Length, _Out_ PIO_STATUS_BLOCK Iosb)
Definition: section.c:4560
UCHAR MmDisablePagingExecutive
Definition: mminit.c:25
VOID NTAPI ExpCheckPoolAllocation(PVOID P, POOL_TYPE PoolType, ULONG Tag)
Definition: expool.c:288
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:4748
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:195
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS SourceAddress
Definition: iotypes.h:1127
SINGLE_LIST_ENTRY NextStackPfn
Definition: mm.h:310
__int64 * PLONG64
Definition: basetsd.h:185
struct _MEMORY_AREA * MemoryArea
Definition: newmm.h:47
BOOLEAN NTAPI MmIsSpecialPoolAddress(IN PVOID P)
PVOID Vad
Definition: mm.h:223
NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase)
Definition: procsup.c:1121
#define APC_LEVEL
Definition: env_spec_w32.h:695
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1519
BOOLEAN NTAPI MmIsDirtyPage(struct _EPROCESS *Process, PVOID Address)
ULONG Flags
Definition: mm.h:220
PLONG64 ReferenceCount
Definition: mm.h:171
base of all file and directory entries
Definition: entries.h:82
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
Definition: mm.h:1541
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:337
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:2819
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Page)
Definition: freelist.c:499
PMMPDE NextPdeForPagedPoolExpansion
Definition: mm.h:417
SIZE_T MmDriverCommit
Definition: freelist.c:32
Definition: dlist.c:348
Definition: mm.h:368
Definition: fci.c:126
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68