ReactOS  0.4.15-dev-2991-g632fa1c
mm.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <internal/arch/mm.h>
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /* TYPES *********************************************************************/
10 
11 struct _EPROCESS;
12 
22 extern ULONG MmThrottleTop;
23 extern ULONG MmThrottleBottom;
24 
26 
28 
30 
34 extern PVOID KernelVerifier;
36 
39 extern SIZE_T MmSharedCommit;
40 extern SIZE_T MmDriverCommit;
41 extern SIZE_T MmProcessCommit;
45 
46 extern PVOID MiDebugMapping; // internal
47 extern PMMPTE MmDebugPte; // internal
48 
49 extern KSPIN_LOCK MmPfnLock;
50 
51 struct _KTRAP_FRAME;
52 struct _EPROCESS;
54 typedef ULONG_PTR SWAPENTRY;
55 
56 //
57 // Special IRQL value (found in assertions)
58 //
59 #define MM_NOIRQL ((KIRQL)0xFFFFFFFF)
60 
61 //
62 // MmDbgCopyMemory Flags
63 //
64 #define MMDBG_COPY_WRITE 0x00000001
65 #define MMDBG_COPY_PHYSICAL 0x00000002
66 #define MMDBG_COPY_UNSAFE 0x00000004
67 #define MMDBG_COPY_CACHED 0x00000008
68 #define MMDBG_COPY_UNCACHED 0x00000010
69 #define MMDBG_COPY_WRITE_COMBINED 0x00000020
70 
71 //
72 // Maximum chunk size per copy
73 //
74 #define MMDBG_COPY_MAX_SIZE 0x8
75 
76 #if defined(_X86_) // intenal for marea.c
77 #define MI_STATIC_MEMORY_AREAS (14)
78 #else
79 #define MI_STATIC_MEMORY_AREAS (13)
80 #endif
81 
82 #define MEMORY_AREA_SECTION_VIEW (1)
83 #ifdef NEWCC
84 #define MEMORY_AREA_CACHE (2)
85 #endif
86 #define MEMORY_AREA_OWNED_BY_ARM3 (15)
87 #define MEMORY_AREA_STATIC (0x80000000)
88 
89 /* Although Microsoft says this isn't hardcoded anymore,
90  they won't be able to change it. Stuff depends on it */
91 #define MM_VIRTMEM_GRANULARITY (64 * 1024)
92 
93 #define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
94 
95 /*
96  * Additional flags for protection attributes
97  */
98 #define PAGE_WRITETHROUGH (1024)
99 #define PAGE_SYSTEM (2048)
100 
101 #define SEC_PHYSICALMEMORY (0x80000000)
102 
103 #define MC_USER (0)
104 #define MC_SYSTEM (1)
105 #define MC_MAXIMUM (2)
106 
107 #define PAGED_POOL_MASK 1
108 #define MUST_SUCCEED_POOL_MASK 2
109 #define CACHE_ALIGNED_POOL_MASK 4
110 #define QUOTA_POOL_MASK 8
111 #define SESSION_POOL_MASK 32
112 #define VERIFIER_POOL_MASK 64
113 
114 #define MAX_PAGING_FILES (16)
115 
116 // FIXME: use ALIGN_UP_BY
117 #define MM_ROUND_UP(x,s) \
118  ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
119 
120 #define MM_ROUND_DOWN(x,s) \
121  ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
122 
123 #define PAGE_FLAGS_VALID_FOR_SECTION \
124  (PAGE_READONLY | \
125  PAGE_READWRITE | \
126  PAGE_WRITECOPY | \
127  PAGE_EXECUTE | \
128  PAGE_EXECUTE_READ | \
129  PAGE_EXECUTE_READWRITE | \
130  PAGE_EXECUTE_WRITECOPY | \
131  PAGE_NOACCESS | \
132  PAGE_NOCACHE)
133 
134 #define PAGE_IS_READABLE \
135  (PAGE_READONLY | \
136  PAGE_READWRITE | \
137  PAGE_WRITECOPY | \
138  PAGE_EXECUTE_READ | \
139  PAGE_EXECUTE_READWRITE | \
140  PAGE_EXECUTE_WRITECOPY)
141 
142 #define PAGE_IS_WRITABLE \
143  (PAGE_READWRITE | \
144  PAGE_WRITECOPY | \
145  PAGE_EXECUTE_READWRITE | \
146  PAGE_EXECUTE_WRITECOPY)
147 
148 #define PAGE_IS_EXECUTABLE \
149  (PAGE_EXECUTE | \
150  PAGE_EXECUTE_READ | \
151  PAGE_EXECUTE_READWRITE | \
152  PAGE_EXECUTE_WRITECOPY)
153 
154 #define PAGE_IS_WRITECOPY \
155  (PAGE_WRITECOPY | \
156  PAGE_EXECUTE_WRITECOPY)
157 
158 //
159 // Wait entry for marking pages that are being serviced
160 //
161 #ifdef _M_IX86
162 #define MM_WAIT_ENTRY 0x7ffffc00
163 #elif defined(_M_AMD64)
164 #define MM_WAIT_ENTRY 0x7FFFFFFFFFFFFC00ULL
165 #else
166 #error Unsupported architecture!
167 #endif
168 
169 #ifdef _M_AMD64
170 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
171  InterlockedCompareExchange64((PLONG64)(PointerPte), Exchange, Comperand)
172 
173 #define InterlockedExchangePte(PointerPte, Value) \
174  InterlockedExchange64((PLONG64)(PointerPte), Value)
175 #else
176 #define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
177  InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
178 
179 #define InterlockedExchangePte(PointerPte, Value) \
180  InterlockedExchange((PLONG)(PointerPte), Value)
181 #endif
182 
183 typedef struct _MM_SECTION_SEGMENT
184 {
187 
188  FAST_MUTEX Lock; /* lock which protects the page directory */
189  LARGE_INTEGER RawLength; /* length of the segment which is part of the mapped file */
190  LARGE_INTEGER Length; /* absolute length of the segment */
197 
198  struct
199  {
200  ULONGLONG FileOffset; /* start offset into the file for image sections */
201  ULONG_PTR VirtualAddress; /* start offset into the address range for image sections */
203  } Image;
204 
206 
208 
211 
213 {
219 
225 
226 #define MM_PHYSICALMEMORY_SEGMENT (0x1)
227 #define MM_DATAFILE_SEGMENT (0x2)
228 #define MM_SEGMENT_INDELETE (0x4)
229 #define MM_SEGMENT_INCREATE (0x8)
230 #define MM_IMAGE_SECTION_FLUSH_DELETE (0x10)
231 
232 
233 #define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn << PAGE_SHIFT)
234 #define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 1) << PAGE_SHIFT)
235 
236 typedef struct _MEMORY_AREA
237 {
239 
245 
246  struct
247  {
251  } SectionData;
253 
254 typedef struct _MM_RMAP_ENTRY
255 {
259 #if DBG
260  PVOID Caller;
261 #endif
262 }
264 
265 #if MI_TRACE_PFNS
268 #define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
269 #define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, min(sizeof(x), sizeof(MI_PFN_CURRENT_PROCESS_NAME)))
271 void
273 {
274  if (!Process)
275  MI_SET_PROCESS2("Kernel");
276  else if (Process == (PEPROCESS)1)
277  MI_SET_PROCESS2("Hydra");
278  else
279  MI_SET_PROCESS2(Process->ImageFileName);
280 }
281 
283 void
284 MI_SET_PROCESS_USTR(PUNICODE_STRING ustr)
285 {
286  PWSTR pos, strEnd;
287  ULONG i;
288 
289  if (!ustr->Buffer || ustr->Length == 0)
290  {
292  return;
293  }
294 
295  pos = strEnd = &ustr->Buffer[ustr->Length / sizeof(WCHAR)];
296  while ((*pos != L'\\') && (pos > ustr->Buffer))
297  pos--;
298 
299  if (*pos == L'\\')
300  pos++;
301 
302  for (i = 0; i < sizeof(MI_PFN_CURRENT_PROCESS_NAME) && pos <= strEnd; i++, pos++)
304 }
305 #else
306 #define MI_SET_USAGE(x)
307 #define MI_SET_PROCESS(x)
308 #define MI_SET_PROCESS2(x)
309 #endif
310 
311 typedef enum _MI_PFN_USAGES
312 {
339 } MI_PFN_USAGES;
340 
341 //
342 // These two mappings are actually used by Windows itself, based on the ASSERTS
343 //
344 #define StartOfAllocation ReadInProgress
345 #define EndOfAllocation WriteInProgress
346 
347 typedef struct _MMPFNENTRY
348 {
350  USHORT ReadInProgress:1; // StartOfAllocation
351  USHORT WriteInProgress:1; // EndOfAllocation
359 } MMPFNENTRY;
360 
361 // Mm internal
362 typedef struct _MMPFN
363 {
364  union
365  {
371 
372  // HACK for ROSPFN
374  } u1;
376  union
377  {
380  } u2;
381  union
382  {
383  struct
384  {
387  };
388  struct
389  {
392  } e2;
393  } u3;
394  union
395  {
398 
399  // HACK for ROSPFN
401  };
402  union
403  {
405  struct
406  {
413  };
414  } u4;
415 #if MI_TRACE_PFNS
416  MI_PFN_USAGES PfnUsage;
417  CHAR ProcessName[16];
418 #define MI_SET_PFN_PROCESS_NAME(pfn, x) memcpy(pfn->ProcessName, x, min(sizeof(x), sizeof(pfn->ProcessName)))
419  PVOID CallSite;
420 #endif
421 
422  // HACK until WS lists are supported
424  struct _MMPFN* NextLRU;
426 } MMPFN, *PMMPFN;
427 
428 extern PMMPFN MmPfnDatabase;
429 
430 typedef struct _MMPFNLIST
431 {
437 
443 
444 typedef struct _MM_MEMORY_CONSUMER
445 {
450 
451 typedef struct _MM_REGION
452 {
458 
459 // Mm internal
460 /* Entry describing free pool memory */
461 typedef struct _MMFREE_POOL_ENTRY
462 {
468 
469 /* Signature of a freed block */
470 #define MM_FREE_POOL_SIGNATURE 'ARM3'
471 
472 /* Paged pool information */
473 typedef struct _MM_PAGED_POOL_INFO
474 {
484 
486 
487 /* Page file information */
488 typedef struct _MMPAGING_FILE
489 {
499 }
501 
503 
504 typedef VOID
508  SIZE_T Length,
509  ULONG OldType,
510  ULONG OldProtect,
511  ULONG NewType,
513 );
514 
515 typedef VOID
517  PVOID Context,
519  PVOID Address,
521  SWAPENTRY SwapEntry,
522  BOOLEAN Dirty
523 );
524 
525 //
526 // Mm copy support for Kd
527 //
528 NTSTATUS
529 NTAPI
532  IN PVOID Buffer,
533  IN ULONG Size,
534  IN ULONG Flags
535 );
536 
537 //
538 // Determines if a given address is a session address
539 //
540 BOOLEAN
541 NTAPI
544 );
545 
546 ULONG
547 NTAPI
550 );
551 
552 ULONG
553 NTAPI
556 );
557 
558 /* marea.c *******************************************************************/
559 
560 NTSTATUS
561 NTAPI
564  ULONG Type,
566  SIZE_T Length,
567  ULONG Protection,
569  ULONG AllocationFlags,
570  ULONG AllocationGranularity
571 );
572 
574 NTAPI
577  PVOID Address
578 );
579 
580 NTSTATUS
581 NTAPI
586  PVOID FreePageContext
587 );
588 
589 VOID
590 NTAPI
593  PMMVAD Vad);
594 
596 NTAPI
599  PVOID Address,
600  SIZE_T Length
601 );
602 
603 PVOID
604 NTAPI
605 MmFindGap(
607  SIZE_T Length,
608  ULONG_PTR Granularity,
609  BOOLEAN TopDown
610 );
611 
612 VOID
613 NTAPI
616 
617 VOID
618 NTAPI
620 
621 /* npool.c *******************************************************************/
622 
623 CODE_SEG("INIT")
624 VOID
625 NTAPI
627 
628 PVOID
629 NTAPI
632  IN SIZE_T SizeInBytes
633 );
634 
635 POOL_TYPE
636 NTAPI
639 );
640 
641 ULONG
642 NTAPI
644  IN PVOID StartingAddress
645 );
646 
647 /* pool.c *******************************************************************/
648 
649 BOOLEAN
650 NTAPI
653  IN ULONG CurrentMaxQuota,
654  OUT PULONG NewMaxQuota
655 );
656 
657 /* mdl.c *********************************************************************/
658 
659 VOID
660 NTAPI
662  PMDL Mdl,
663  PPFN_NUMBER Pages
664 );
665 
666 /* mminit.c ******************************************************************/
667 
668 VOID
669 NTAPI
670 MmInit1(
671  VOID
672 );
673 
674 CODE_SEG("INIT")
675 BOOLEAN
676 NTAPI
677 MmInitSystem(IN ULONG Phase,
678  IN PLOADER_PARAMETER_BLOCK LoaderBlock);
679 
680 
681 /* pagefile.c ****************************************************************/
682 
683 SWAPENTRY
684 NTAPI
686 
687 VOID
688 NTAPI
690 
691 CODE_SEG("INIT")
692 VOID
693 NTAPI
695 
696 BOOLEAN
697 NTAPI
699 
700 NTSTATUS
701 NTAPI
703  SWAPENTRY SwapEntry,
705 );
706 
707 NTSTATUS
708 NTAPI
710  SWAPENTRY SwapEntry,
712 );
713 
714 VOID
715 NTAPI
717 
718 NTSTATUS
719 NTAPI
722  _In_ ULONG PageFileIndex,
723  _In_ ULONG_PTR PageFileOffset);
724 
725 /* process.c ****************************************************************/
726 
727 NTSTATUS
728 NTAPI
731  IN PEPROCESS Clone OPTIONAL,
732  IN PVOID Section OPTIONAL,
733  IN OUT PULONG Flags,
735 );
736 
737 NTSTATUS
738 NTAPI
741  IN PINITIAL_PEB InitialPeb,
742  OUT PPEB *BasePeb
743 );
744 
745 NTSTATUS
746 NTAPI
750  IN PINITIAL_TEB InitialTeb,
751  OUT PTEB* BaseTeb
752 );
753 
754 VOID
755 NTAPI
758  PTEB Teb
759 );
760 
761 VOID
762 NTAPI
764 
765 VOID
766 NTAPI
768 
769 ULONG
770 NTAPI
772 
773 NTSTATUS
774 NTAPI
777  IN UCHAR MemoryPriority
778 );
779 
780 /* i386/pfault.c *************************************************************/
781 
782 NTSTATUS
783 NTAPI
785  ULONG Cs,
786  PULONG Eip,
787  PULONG Eax,
788  ULONG Cr2,
790 );
791 
792 /* special.c *****************************************************************/
793 
794 VOID
795 NTAPI
797 
798 BOOLEAN
799 NTAPI
802  IN ULONG Tag);
803 
804 BOOLEAN
805 NTAPI
807  IN PVOID P);
808 
809 BOOLEAN
810 NTAPI
812  IN PVOID P);
813 
814 PVOID
815 NTAPI
818  IN ULONG Tag,
820  IN ULONG SpecialType);
821 
822 VOID
823 NTAPI
825  IN PVOID P);
826 
827 /* mm.c **********************************************************************/
828 
829 NTSTATUS
830 NTAPI
832  IN ULONG FaultCode,
833  IN PVOID Address,
835  IN PVOID TrapInformation
836 );
837 
838 /* process.c *****************************************************************/
839 
840 PVOID
841 NTAPI
843 
844 VOID
845 NTAPI
847  BOOLEAN GuiStack);
848 
849 /* balance.c *****************************************************************/
850 
851 CODE_SEG("INIT")
852 VOID
853 NTAPI
855  ULONG Consumer,
856  NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
857 );
858 
859 CODE_SEG("INIT")
860 VOID
861 NTAPI
863  ULONG NrAvailablePages,
864  ULONG NrSystemPages
865 );
866 
867 NTSTATUS
868 NTAPI
870  ULONG Consumer,
872 );
873 
874 NTSTATUS
875 NTAPI
877  ULONG Consumer,
878  BOOLEAN MyWait,
879  PPFN_NUMBER AllocatedPage
880 );
881 
882 CODE_SEG("INIT")
883 VOID
884 NTAPI
886 
887 VOID
888 NTAPI
890 
891 /* rmap.c **************************************************************/
892 #define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff)
893 #define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
894 
895 VOID
896 NTAPI
899  struct _MM_RMAP_ENTRY* ListHead
900 );
901 
902 struct _MM_RMAP_ENTRY*
903 NTAPI
905 
906 VOID
907 NTAPI
910  struct _EPROCESS *Process,
911  PVOID Address
912 );
913 
914 VOID
915 NTAPI
918  PVOID Context,
919  VOID (*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address)
920 );
921 
922 VOID
923 NTAPI
926  struct _EPROCESS *Process,
927  PVOID Address
928 );
929 
930 CODE_SEG("INIT")
931 VOID
932 NTAPI
934 
935 NTSTATUS
936 NTAPI
938 
940 NTAPI
943 
944 /* freelist.c **********************************************************/
951 KIRQL
952 MiAcquirePfnLock(VOID)
953 {
955 }
956 
961 VOID
962 MiReleasePfnLock(
964 {
966 }
967 
972 VOID
973 MiAcquirePfnLockAtDpcLevel(VOID)
974 {
975  PKSPIN_LOCK_QUEUE LockQueue;
976 
978  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
979  KeAcquireQueuedSpinLockAtDpcLevel(LockQueue);
980 }
981 
986 VOID
987 MiReleasePfnLockFromDpcLevel(VOID)
988 {
989  PKSPIN_LOCK_QUEUE LockQueue;
990 
991  LockQueue = &KeGetCurrentPrcb()->LockQueue[LockQueuePfnLock];
992  KeReleaseQueuedSpinLockFromDpcLevel(LockQueue);
994 }
995 
996 #define MI_ASSERT_PFN_LOCK_HELD() NT_ASSERT((KeGetCurrentIrql() >= DISPATCH_LEVEL) && (MmPfnLock != 0))
997 
999 PMMPFN
1001 {
1002  PMMPFN Page;
1003  extern RTL_BITMAP MiPfnBitMap;
1004 
1005  /* Make sure the PFN number is valid */
1006  if (Pfn > MmHighestPhysicalPage) return NULL;
1007 
1008  /* Make sure this page actually has a PFN entry */
1009  if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL;
1010 
1011  /* Get the entry */
1012  Page = &MmPfnDatabase[Pfn];
1013 
1014  /* Return it */
1015  return Page;
1016 };
1017 
1019 PFN_NUMBER
1021 {
1022  //
1023  // This will return the Page Frame Number (PFN) from the MMPFN
1024  //
1025  return Pfn1 - MmPfnDatabase;
1026 }
1027 
1028 PFN_NUMBER
1029 NTAPI
1030 MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast);
1031 
1032 PFN_NUMBER
1033 NTAPI
1035 
1036 VOID
1037 NTAPI
1039  IN BOOLEAN StatusOnly
1040 );
1041 
1042 VOID
1043 NTAPI
1045  VOID
1046 );
1047 
1048 /* hypermap.c *****************************************************************/
1049 PVOID
1050 NTAPI
1052  IN PFN_NUMBER Page,
1053  IN PKIRQL OldIrql);
1054 
1055 VOID
1056 NTAPI
1058  IN PVOID Address,
1059  IN KIRQL OldIrql);
1060 
1061 PVOID
1062 NTAPI
1064  IN PFN_NUMBER NumberOfPages);
1065 
1066 VOID
1067 NTAPI
1069  IN PFN_NUMBER NumberOfPages);
1070 
1071 /* i386/page.c *********************************************************/
1072 
1073 NTSTATUS
1074 NTAPI
1076  struct _EPROCESS* Process,
1077  PVOID Address,
1078  ULONG flProtect,
1080 );
1081 
1082 NTSTATUS
1083 NTAPI
1085  struct _EPROCESS* Process,
1086  PVOID Address,
1087  ULONG flProtect,
1089 );
1090 
1091 ULONG
1092 NTAPI
1094  struct _EPROCESS* Process,
1095  PVOID Address);
1096 
1097 VOID
1098 NTAPI
1100  struct _EPROCESS* Process,
1101  PVOID Address,
1102  ULONG flProtect
1103 );
1104 
1105 BOOLEAN
1106 NTAPI
1108  struct _EPROCESS* Process,
1109  PVOID Address
1110 );
1111 
1112 BOOLEAN
1113 NTAPI
1115  struct _EPROCESS* Process,
1116  PVOID Address
1117 );
1118 
1119 CODE_SEG("INIT")
1120 VOID
1121 NTAPI
1123 
1124 VOID
1125 NTAPI
1128  PVOID Address,
1129  SWAPENTRY* SwapEntry
1130 );
1131 
1132 NTSTATUS
1133 NTAPI
1136  PVOID Address,
1137  SWAPENTRY SwapEntry
1138 );
1139 
1140 VOID
1141 NTAPI
1144  PVOID Address,
1145  SWAPENTRY *SwapEntry);
1146 
1147 BOOLEAN
1148 NTAPI
1151  PVOID Address
1152 );
1153 
1154 PFN_NUMBER
1155 NTAPI
1156 MmAllocPage(
1157  ULONG Consumer
1158 );
1159 
1160 VOID
1161 NTAPI
1163 
1164 VOID
1165 NTAPI
1167 
1168 ULONG
1169 NTAPI
1171 
1172 BOOLEAN
1173 NTAPI
1175 
1176 VOID
1177 NTAPI
1179  PFN_NUMBER Page,
1180  SWAPENTRY SavedSwapEntry);
1181 
1182 SWAPENTRY
1183 NTAPI
1185 
1186 VOID
1187 NTAPI
1190  PVOID Address
1191 );
1192 
1193 VOID
1194 NTAPI
1196 #define MmSetCleanPage(__P, __A) MmSetDirtyBit(__P, __A, FALSE)
1197 #define MmSetDirtyPage(__P, __A) MmSetDirtyBit(__P, __A, TRUE)
1198 
1199 VOID
1200 NTAPI
1202  struct _EPROCESS *Process,
1203  PVOID Address
1204 );
1205 
1206 PFN_NUMBER
1207 NTAPI
1209  struct _EPROCESS *Process,
1210  PVOID Address
1211 );
1212 
1213 BOOLEAN
1214 NTAPI
1216  IN ULONG MinWs,
1217  IN PEPROCESS Dest,
1218  IN PULONG_PTR DirectoryTableBase
1219 );
1220 
1221 CODE_SEG("INIT")
1222 NTSTATUS
1223 NTAPI
1226  IN PULONG_PTR DirectoryTableBase
1227 );
1228 
1229 CODE_SEG("INIT")
1230 NTSTATUS
1231 NTAPI
1234 );
1235 
1236 NTSTATUS
1237 NTAPI
1238 MmSetExecuteOptions(IN ULONG ExecuteOptions);
1239 
1240 NTSTATUS
1241 NTAPI
1242 MmGetExecuteOptions(IN PULONG ExecuteOptions);
1243 
1244 VOID
1245 NTAPI
1248  PVOID Address,
1249  BOOLEAN* WasDirty,
1251 );
1252 
1253 /* arch/procsup.c ************************************************************/
1254 
1255 BOOLEAN
1258  _In_ PULONG_PTR DirectoryTableBase);
1259 
1260 /* wset.c ********************************************************************/
1261 
1262 NTSTATUS
1264  ULONG Target,
1265  ULONG Priority,
1266  PULONG NrFreedPages
1267 );
1268 
1269 /* region.c ************************************************************/
1270 
1271 NTSTATUS
1272 NTAPI
1276  PLIST_ENTRY RegionListHead,
1277  PVOID StartAddress,
1278  SIZE_T Length,
1279  ULONG NewType,
1280  ULONG NewProtect,
1281  PMM_ALTER_REGION_FUNC AlterFunc
1282 );
1283 
1284 VOID
1285 NTAPI
1287  PLIST_ENTRY RegionListHead,
1288  SIZE_T Length,
1289  ULONG Type,
1290  ULONG Protect
1291 );
1292 
1293 PMM_REGION
1294 NTAPI
1295 MmFindRegion(
1297  PLIST_ENTRY RegionListHead,
1298  PVOID Address,
1299  PVOID* RegionBaseAddress
1300 );
1301 
1302 /* section.c *****************************************************************/
1303 
1304 #define PFN_FROM_SSE(E) ((PFN_NUMBER)((E) >> PAGE_SHIFT))
1305 #define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
1306 #define MM_IS_WAIT_PTE(E) \
1307  (IS_SWAP_FROM_SSE(E) && SWAPENTRY_FROM_SSE(E) == MM_WAIT_ENTRY)
1308 #define MAKE_PFN_SSE(P) ((ULONG_PTR)((P) << PAGE_SHIFT))
1309 #define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
1310 #define MAKE_SWAP_SSE(S) (((ULONG_PTR)(S) << 1) | 0x1)
1311 #define DIRTY_SSE(E) ((E) | 2)
1312 #define CLEAN_SSE(E) ((E) & ~2)
1313 #define IS_DIRTY_SSE(E) ((E) & 2)
1314 #define WRITE_SSE(E) ((E) | 4)
1315 #define IS_WRITE_SSE(E) ((E) & 4)
1316 #ifdef _WIN64
1317 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFFFF000ULL)
1318 #else
1319 #define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
1320 #endif
1321 #define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
1322 #define MAX_SHARE_COUNT 0x1FF
1323 #define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
1324 #define BUMPREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) + 1) << 3) | ((E) & 0x7))
1325 #define DECREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) - 1) << 3) | ((E) & 0x7))
1326 
1327 VOID
1328 NTAPI
1330  const char *file,
1331  int line);
1332 
1333 #define MmLockSectionSegment(x) _MmLockSectionSegment(x,__FILE__,__LINE__)
1334 
1335 VOID
1336 NTAPI
1338  const char *file,
1339  int line);
1340 
1341 #define MmUnlockSectionSegment(x) _MmUnlockSectionSegment(x,__FILE__,__LINE__)
1342 
1343 VOID
1344 NTAPI
1346  OUT PSECTION_IMAGE_INFORMATION ImageInformation
1347 );
1348 
1350 NTAPI
1352  IN PVOID Section
1353 );
1354 NTSTATUS
1355 NTAPI
1357  IN PVOID Address,
1359 );
1360 
1361 NTSTATUS
1362 NTAPI
1364  IN PVOID Section,
1366 );
1367 
1368 NTSTATUS
1369 NTAPI
1372  PVOID Address,
1375 );
1376 
1377 NTSTATUS
1378 NTAPI
1383  SIZE_T Length,
1384  ULONG Protect,
1385  PULONG OldProtect
1386 );
1387 
1388 CODE_SEG("INIT")
1389 NTSTATUS
1390 NTAPI
1392 
1393 NTSTATUS
1394 NTAPI
1398  PVOID Address,
1399  BOOLEAN Locked
1400 );
1401 
1402 NTSTATUS
1403 NTAPI
1407  PVOID Address,
1409 );
1410 
1411 CODE_SEG("INIT")
1412 NTSTATUS
1413 NTAPI
1415 
1416 NTSTATUS
1417 NTAPI
1421  PVOID Address,
1422  BOOLEAN Locked
1423 );
1424 
1425 VOID
1426 NTAPI
1428 
1429 /* Exported from NT 6.2 Onward. We keep it internal. */
1430 NTSTATUS
1431 NTAPI
1433  _In_ PVOID Section,
1438  );
1439 
1440 BOOLEAN
1441 NTAPI
1445  _In_ ULONG Length);
1446 
1447 NTSTATUS
1448 NTAPI
1451  _In_ PVOID Address,
1452  _In_ ULONG Length);
1453 
1454 NTSTATUS
1455 NTAPI
1459  _In_ ULONG Length,
1461 
1462 NTSTATUS
1463 NTAPI
1467  _In_ ULONG Length,
1468  _In_ PLARGE_INTEGER ValidDataLength);
1469 
1470 BOOLEAN
1471 NTAPI
1475  _In_ ULONG Length);
1476 
1477 BOOLEAN
1478 NTAPI
1483  BOOLEAN PageOut);
1484 
1485 BOOLEAN
1486 NTAPI
1490  BOOLEAN Dirty,
1491  BOOLEAN PageOut,
1492  ULONG_PTR *InEntry);
1493 
1500 VOID
1501 NTAPI
1502 MmDereferenceSegmentWithLock(PMM_SECTION_SEGMENT Segment, KIRQL OldIrql);
1503 
1507 VOID
1508 MmDereferenceSegment(PMM_SECTION_SEGMENT Segment)
1509 {
1510  MmDereferenceSegmentWithLock(Segment, MM_NOIRQL);
1511 }
1512 
1513 NTSTATUS
1514 NTAPI
1516  _In_ PVOID Section,
1518 
1519 /* sptab.c *******************************************************************/
1520 
1521 NTSTATUS
1522 NTAPI
1525  ULONG_PTR Entry,
1526  const char *file,
1527  int line);
1528 
1529 ULONG_PTR
1530 NTAPI
1533  const char *file,
1534  int line);
1535 
1536 #define MmSetPageEntrySectionSegment(S,O,E) _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__)
1537 
1538 #define MmGetPageEntrySectionSegment(S,O) _MmGetPageEntrySectionSegment(S,O,__FILE__,__LINE__)
1539 
1540 /* sysldr.c ******************************************************************/
1541 
1542 CODE_SEG("INIT")
1543 VOID
1544 NTAPI
1546  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1547 );
1548 
1549 CODE_SEG("INIT")
1550 BOOLEAN
1551 NTAPI
1553  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1554 );
1555 
1556 BOOLEAN
1557 NTAPI
1559 
1560 VOID
1561 NTAPI
1563 
1564 NTSTATUS
1565 NTAPI
1568  IN PUNICODE_STRING NamePrefix OPTIONAL,
1569  IN PUNICODE_STRING LoadedName OPTIONAL,
1570  IN ULONG Flags,
1571  OUT PVOID *ModuleObject,
1572  OUT PVOID *ImageBaseAddress
1573 );
1574 
1575 NTSTATUS
1576 NTAPI
1578  IN PVOID ImageHandle
1579 );
1580 
1581 NTSTATUS
1582 NTAPI
1584  IN HANDLE ImageHandle,
1585  IN BOOLEAN PurgeSection
1586 );
1587 
1588 NTSTATUS
1589 NTAPI
1591  IN PLDR_DATA_TABLE_ENTRY LdrEntry,
1592  IN PLIST_ENTRY ListHead
1593 );
1594 
1595 VOID
1596 NTAPI
1598  IN PLDR_DATA_TABLE_ENTRY LdrEntry);
1599 
1600 /* procsup.c *****************************************************************/
1601 
1602 NTSTATUS
1603 NTAPI
1605  IN PVOID StackPointer
1606 );
1607 
1608 
1610 VOID
1612 {
1613  KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1614 }
1615 
1617 VOID
1619 {
1620  KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, Vm)->AddressCreationLock);
1621 }
1622 
1624 PEPROCESS
1626 {
1627  if (AddressSpace == MmKernelAddressSpace) return NULL;
1629 }
1630 
1632 PMMSUPPORT
1634 {
1635  return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->Vm;
1636 }
1637 
1639 PMMSUPPORT
1641 {
1642  return MmKernelAddressSpace;
1643 }
1644 
1645 
1646 /* expool.c ******************************************************************/
1647 
1648 VOID
1649 NTAPI
1651  PVOID P,
1653  ULONG Tag);
1654 
1655 VOID
1656 NTAPI
1658  IN PVOID P);
1659 
1660 
1661 /* mmsup.c *****************************************************************/
1662 
1663 NTSTATUS
1664 NTAPI
1666  IN SIZE_T WorkingSetMinimumInBytes,
1667  IN SIZE_T WorkingSetMaximumInBytes,
1668  IN ULONG SystemCache,
1669  IN BOOLEAN IncreaseOkay);
1670 
1671 
1672 /* session.c *****************************************************************/
1673 
1675 NTSTATUS
1676 NTAPI
1677 MmAttachSession(
1678  _Inout_ PVOID SessionEntry,
1680 
1682 VOID
1683 NTAPI
1684 MmDetachSession(
1685  _Inout_ PVOID SessionEntry,
1687 
1688 VOID
1689 NTAPI
1691  _Inout_ PVOID SessionEntry);
1692 
1693 PVOID
1694 NTAPI
1696  _In_ ULONG SessionId);
1697 
1699 VOID
1700 NTAPI
1701 MmSetSessionLocaleId(
1702  _In_ LCID LocaleId);
1703 
1704 /* shutdown.c *****************************************************************/
1705 
1706 VOID
1707 MmShutdownSystem(IN ULONG Phase);
1708 
1709 /* virtual.c *****************************************************************/
1710 
1711 NTSTATUS
1712 NTAPI
1713 MmCopyVirtualMemory(IN PEPROCESS SourceProcess,
1715  IN PEPROCESS TargetProcess,
1719  OUT PSIZE_T ReturnSize);
1720 
1721 /* wslist.cpp ****************************************************************/
1722 _Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex)
1723 VOID
1724 NTAPI
1726 
1727 #ifdef __cplusplus
1728 } // extern "C"
1729 
1730 namespace ntoskrnl
1731 {
1732 using MiPfnLockGuard = const KiQueuedSpinLockGuard<LockQueuePfnLock>;
1733 } // namespace ntoskrnl
1734 
1735 #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:5088
PRTL_BITMAP PagedPoolAllocationMap
Definition: mm.h:475
PULONG Buffer
Definition: typedefs.h:91
ULONG_PTR VirtualAddress
Definition: mm.h:201
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:739
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1734
BOOLEAN WriteCopy
Definition: mm.h:195
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:257
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:505
VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject)
#define _In_opt_
Definition: ms_sal.h:309
ULONG Type
Definition: mm.h:240
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:202
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
NTSTATUS NTAPI MmGetFileNameForSection(IN PVOID Section, OUT POBJECT_NAME_INFORMATION *ModuleName)
Definition: section.c:1861
ULONG PFN_COUNT
Definition: mmtypes.h:102
ULONG NTAPI MmGetPageProtect(struct _EPROCESS *Process, PVOID Address)
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Page)
Definition: freelist.c:558
USHORT ReadInProgress
Definition: mm.h:350
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:4774
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:410
ULONG Signature
Definition: mm.h:465
ULONG PagesTarget
Definition: mm.h:447
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:433
char CHAR
Definition: xmlstorage.h:175
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1618
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:4629
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion(PMMSUPPORT AddressSpace, PVOID Address, SIZE_T Length)
Definition: marea.c:106
PMM_RMAP_ENTRY RmapListHead
Definition: mm.h:400
struct _MM_PAGED_POOL_INFO MM_PAGED_POOL_INFO
NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID)
Definition: section.c:2162
Definition: mm.h:451
ULONG SectionCount
Definition: mm.h:192
struct _MM_RMAP_ENTRY MM_RMAP_ENTRY
LONG NTSTATUS
Definition: precomp.h:26
PFN_NUMBER Size
Definition: mm.h:490
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
_IRQL_restores_(OldIrql)) _When_(OldIrql !
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1079
PFN_NUMBER Flink
Definition: mm.h:366
struct _EPROCESS * PEPROCESS
Definition: nt_native.h:30
LIST_ENTRY RegionListHead
Definition: mm.h:250
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
Definition: balance.c:78
union _MMPFN::@1761 u3
SIZE_T MmSharedCommit
Definition: freelist.c:31
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:275
VOID(* PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
Definition: mm.h:516
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
USHORT Modified
Definition: mm.h:349
PMM_SECTION_SEGMENT Segment
Definition: mm.h:249
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:355
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:4682
DWORD LCID
Definition: nls.h:13
PFILE_OBJECT FileObject
Definition: mm.h:495
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:1882
VOID NTAPI MmDeletePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
NTSTATUS NTAPI MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
Definition: pagefile.c:187
BOOLEAN NTAPI MmCheckDirtySegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN ForceDirty, BOOLEAN PageOut)
NTSTATUS NTAPI MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes, IN SIZE_T WorkingSetMaximumInBytes, IN ULONG SystemCache, IN BOOLEAN IncreaseOkay)
Definition: mmsup.c:44
PFN_NUMBER MmAvailablePages
Definition: freelist.c:26
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
Definition: marea.c:60
_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:385
PVOID NTAPI MmAllocateSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag, IN POOL_TYPE PoolType, IN ULONG SpecialType)
MMPFNLIST MmStandbyPageListHead
Definition: pfnlist.c:43
struct _MM_SECTION_SEGMENT::@1757 Image
USHORT PageLocation
Definition: mm.h:354
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:434
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:423
_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:945
USHORT PrototypePte
Definition: mm.h:352
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
UCHAR KIRQL
Definition: env_spec_w32.h:591
MMPFNENTRY e1
Definition: mm.h:386
ULONG * PPFN_NUMBER
Definition: ke.h:9
ULONG Magic
Definition: mm.h:243
_Releases_lock_(MmPfnLock)) _When_(OldIrql !
NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, PSIZE_T ResultLength)
Definition: section.c:2058
BOOLEAN NTAPI MmIsPagePresent(struct _EPROCESS *Process, PVOID Address)
VOID NTAPI MmInitializeMemoryConsumer(ULONG Consumer, NTSTATUS(*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed))
Definition: balance.c:63
VOID NTAPI MmInitPagingFile(VOID)
Definition: pagefile.c:255
USHORT CacheAttribute
Definition: mm.h:356
PLARGE_INTEGER BOOLEAN ForceDirty
Definition: section.c:4882
#define MC_MAXIMUM
Definition: mm.h:105
VOID NTAPI MmZeroPageThread(VOID)
Definition: zeropage.c:36
_IRQL_requires_(DISPATCH_LEVEL)) VOID NTAPI MmDereferenceSegmentWithLock(PMM_SECTION_SEGMENT Segment
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:4794
#define MM_NOIRQL
Definition: mm.h:59
RTL_BITMAP MiPfnBitMap
Definition: init.c:44
ULONG PFN_NUMBER
Definition: ke.h:9
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
Definition: freelist.c:125
NTSTATUS NTAPI MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, SIZE_T Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
Definition: region.c:108
VOID NTAPI MmGetImageInformation(OUT PSECTION_IMAGE_INFORMATION ImageInformation)
Definition: section.c:1808
ULONG_PTR MustBeCached
Definition: mm.h:412
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:2253
PMMPTE LastPteForPagedPool
Definition: mm.h:478
ULONG Type
Definition: mm.h:453
struct _MM_MEMORY_CONSUMER * PMM_MEMORY_CONSUMER
#define MI_SET_PROCESS(x)
Definition: mm.h:307
struct _MMPFNLIST * PMMPFNLIST
ULONG_PTR ShareCount
Definition: mm.h:379
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:193
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
VOID NTAPI MmRebalanceMemoryConsumers(VOID)
Definition: balance.c:265
long LONG
Definition: pedump.c:60
USHORT ParityError
Definition: mm.h:358
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:435
PKEVENT Event
Definition: mm.h:368
#define MI_SET_PROCESS2(x)
Definition: mm.h:308
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:463
_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
_IRQL_requires_max_(DISPATCH_LEVEL) _Requires_lock_not_held_(MmPfnLock) FORCEINLINE VOID MmDereferenceSegment(PMM_SECTION_SEGMENT Segment)
Definition: mm.h:1504
NTSTATUS NTAPI MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1884
NTSTATUS NTAPI MmGetExecuteOptions(IN PULONG ExecuteOptions)
Definition: pagfault.c:2572
BOOLEAN Locked
Definition: mm.h:196
unsigned char BOOLEAN
SIZE_T AllocatedPagedPool
Definition: mm.h:482
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:409
SIZE_T Length
Definition: mm.h:455
_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:4888
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:425
SIZE_T MmTotalCommittedPages
Definition: freelist.c:30
union _MMPFN::@1760 u2
VOID NTAPI MmQuitNextSession(_Inout_ PVOID SessionEntry)
Definition: session.c:1030
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
Definition: procsup.c:458
SIZE_T PagedPoolCommit
Definition: mm.h:481
PFN_NUMBER MaximumSize
Definition: mm.h:491
PFN_NUMBER MinimumSize
Definition: mm.h:492
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:186
UNICODE_STRING PageFileName
Definition: mm.h:496
_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:454
USHORT WriteInProgress
Definition: mm.h:351
KIRQL OldIrql
Definition: mm.h:1502
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:190
PMMPTE MmDebugPte
Definition: mmdbg.c:31
ULONGLONG FileOffset
Definition: mm.h:200
FAST_MUTEX
Definition: extypes.h:17
BOOLEAN NTAPI MmIsSpecialPoolAddressFree(IN PVOID P)
PFN_COUNT Size
Definition: mm.h:464
int64_t LONGLONG
Definition: typedefs.h:68
VOID NTAPI MmCleanProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1230
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:311
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:44
PFN_NUMBER FreeSpace
Definition: mm.h:493
struct _MMPFNLIST MMPFNLIST
#define MAX_PAGING_FILES
Definition: mm.h:114
__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:499
Definition: mm.h:461
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:448
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:223
PLARGE_INTEGER BOOLEAN BOOLEAN PageOut
Definition: section.c:4885
struct _MMPAGING_FILE MMPAGING_FILE
BOOLEAN DeleteInProgress
Definition: mm.h:242
BOOLEAN NTAPI MmIsDisabledPage(struct _EPROCESS *Process, PVOID Address)
LARGE_INTEGER RawLength
Definition: mm.h:189
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:968
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:238
LIST_ENTRY MmLoadedUserImageList
Definition: sysldr.c:35
struct _MMFREE_POOL_ENTRY * Owner
Definition: mm.h:466
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:916
struct _MM_REGION MM_REGION
NTSTATUS NTAPI MmSetExecuteOptions(IN ULONG ExecuteOptions)
Definition: pagfault.c:2614
static const WCHAR L[]
Definition: oid.c:1250
#define NTSTATUS
Definition: precomp.h:20
#define VOID
Definition: acefi.h:82
Definition: mm.h:362
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:4314
NTSTATUS NTAPI MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
Definition: procsup.c:1120
VOID NTAPI MiInitBalancerThread(VOID)
Definition: balance.c:396
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:207
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:411
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
Definition: mm.h:1000
#define P(row, col)
NTSTATUS ReadStatus
Definition: mm.h:369
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:498
#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:248
PFILE_OBJECT FileObject
Definition: mm.h:215
ULONG_PTR SIZE_T
Definition: typedefs.h:80
Definition: compat.h:694
PULONG Flags
Definition: mm.h:194
PFN_NUMBER CurrentUsage
Definition: mm.h:494
USHORT PageColor
Definition: mm.h:353
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
Definition: mm.h:1640
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
PRTL_BITMAP Bitmap
Definition: mm.h:497
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:5017
struct _MM_REGION * PMM_REGION
NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
Definition: balance.c:143
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID NTAPI MiUnmapPagesInZeroSpace(IN PVOID VirtualAddress, IN PFN_NUMBER NumberOfPages)
Definition: hypermap.c:183
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:48
ULONG_PTR PteFrame
Definition: mm.h:407
struct _MMFREE_POOL_ENTRY * PMMFREE_POOL_ENTRY
PFN_COUNT MiUsedSwapPages
Definition: pagefile.c:52
PRTL_BITMAP EndOfPagedPoolBitmap
Definition: mm.h:476
PFN_NUMBER Total
Definition: mm.h:432
USHORT ShortFlags
Definition: mm.h:391
struct _MMPFN * PMMPFN
ULONG_PTR SWAPENTRY
Definition: mm.h:53
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct _MMPFN::@1761::@1767 e2
NTSTATUS NTAPI MmSetMemoryPriorityProcess(IN PEPROCESS Process, IN UCHAR MemoryPriority)
Definition: procsup.c:468
#define FORCEINLINE
Definition: wdftypes.h:67
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1679
FORCEINLINE PEPROCESS MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace)
Definition: mm.h:1625
_Must_inspect_result_ _In_ ULONG NewProtect
Definition: mmfuncs.h:682
USHORT Rom
Definition: mm.h:357
PMMPTE PteAddress
Definition: mm.h:375
#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:404
#define NULL
Definition: types.h:112
MMPTE OriginalPte
Definition: mm.h:396
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::@1758 SectionData
_Requires_exclusive_lock_held_(WorkingSet->WorkingSetMutex) VOID NTAPI MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet)
SWAPENTRY SwapEntry
Definition: mm.h:373
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
struct _MM_RMAP_ENTRY * Next
Definition: mm.h:256
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
_Requires_lock_held_(MmPfnLock) _Releases_lock_(MmPfnLock) _IRQL_requires_(DISPATCH_LEVEL) FORCEINLINE VOID MiReleasePfnLock(_In_ _IRQL_restores_ KIRQL OldIrql)
Definition: mm.h:957
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:367
enum _MI_PFN_USAGES MI_PFN_USAGES
union _MMPFN::@1759 u1
PFN_NUMBER Blink
Definition: mm.h:378
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:2022
FAST_MUTEX Lock
Definition: mm.h:188
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
Definition: mm.h:1020
struct tagContext Context
Definition: acpixf.h:1034
SECTION_IMAGE_INFORMATION ImageInformation
Definition: mm.h:220
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:209
PFN_COUNT MiFreeSwapPages
Definition: pagefile.c:49
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY RegionListEntry
Definition: mm.h:456
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:254
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 _MM_MEMORY_CONSUMER MM_MEMORY_CONSUMER
VOID NTAPI MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit)
Definition: page.c:810
_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:446
VOID NTAPI MiInitializeNonPagedPool(VOID)
Definition: pool.c:276
ULONG PagedPoolHint
Definition: mm.h:480
PVOID Address
Definition: mm.h:258
ULONG_PTR InPageError
Definition: mm.h:408
ULONG SegFlags
Definition: mm.h:205
BOOLEAN NTAPI MiRaisePoolQuota(IN POOL_TYPE PoolType, IN ULONG CurrentMaxQuota, OUT PULONG NewMaxQuota)
Definition: pool.c:1275
#define MmSetCleanPage(__P, __A)
Definition: mm.h:1196
PVOID NTAPI MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node)
#define KeGetCurrentThread
Definition: hal.h:55
struct _MMPFN * NextLRU
Definition: mm.h:424
NTSTATUS NTAPI MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
Definition: section.c:1518
PMMPTE FirstPteForPagedPool
Definition: mm.h:477
#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
SINGLE_LIST_ENTRY NextStackPfn
Definition: mm.h:370
VOID NTAPI MmDeleteProcessAddressSpace(IN PEPROCESS Process)
Definition: procsup.c:1321
__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:244
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase)
Definition: procsup.c:1095
#define APC_LEVEL
Definition: env_spec_w32.h:695
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
Definition: mm.h:1611
#define _IRQL_saves_
Definition: driverspecs.h:235
ULONG Flags
Definition: mm.h:241
PLONG64 ReferenceCount
Definition: mm.h:191
base of all file and directory entries
Definition: entries.h:82
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
Definition: mm.h:1633
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:1280
LONG AweReferenceCount
Definition: mm.h:397
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:479
SIZE_T MmDriverCommit
Definition: freelist.c:32
Definition: dlist.c:348
Definition: mm.h:430
Definition: fci.c:126
union _MMPFN::@1764 u4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68