62#define MI_QUOTA_NON_PAGED_NEEDED_PAGES 64
63#define MI_NON_PAGED_QUOTA_MIN_RESIDENT_PAGES 200
64#define MI_CHARGE_PAGED_POOL_QUOTA 0x80000
65#define MI_CHARGE_NON_PAGED_POOL_QUOTA 0x10000
70#define MM_NOIRQL ((KIRQL)0xFFFFFFFF)
75#define MMDBG_COPY_WRITE 0x00000001
76#define MMDBG_COPY_PHYSICAL 0x00000002
77#define MMDBG_COPY_UNSAFE 0x00000004
78#define MMDBG_COPY_CACHED 0x00000008
79#define MMDBG_COPY_UNCACHED 0x00000010
80#define MMDBG_COPY_WRITE_COMBINED 0x00000020
85#define MMDBG_COPY_MAX_SIZE 0x8
88#define MI_STATIC_MEMORY_AREAS (14)
90#define MI_STATIC_MEMORY_AREAS (13)
93#define MEMORY_AREA_SECTION_VIEW (1)
95#define MEMORY_AREA_CACHE (2)
97#define MEMORY_AREA_OWNED_BY_ARM3 (15)
98#define MEMORY_AREA_STATIC (0x80000000)
102#define MM_VIRTMEM_GRANULARITY (64 * 1024)
104#define STATUS_MM_RESTART_OPERATION ((NTSTATUS)0xD0000001)
109#define PAGE_WRITETHROUGH (1024)
110#define PAGE_SYSTEM (2048)
112#define SEC_PHYSICALMEMORY (0x80000000)
116#define MC_MAXIMUM (2)
118#define PAGED_POOL_MASK 1
119#define MUST_SUCCEED_POOL_MASK 2
120#define CACHE_ALIGNED_POOL_MASK 4
121#define QUOTA_POOL_MASK 8
122#define SESSION_POOL_MASK 32
123#define VERIFIER_POOL_MASK 64
125#define MAX_PAGING_FILES (16)
128#define MM_ROUND_UP(x,s) \
129 ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
131#define MM_ROUND_DOWN(x,s) \
132 ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
134#define PAGE_FLAGS_VALID_FOR_SECTION \
139 PAGE_EXECUTE_READ | \
140 PAGE_EXECUTE_READWRITE | \
141 PAGE_EXECUTE_WRITECOPY | \
145#define PAGE_IS_READABLE \
149 PAGE_EXECUTE_READ | \
150 PAGE_EXECUTE_READWRITE | \
151 PAGE_EXECUTE_WRITECOPY)
153#define PAGE_IS_WRITABLE \
156 PAGE_EXECUTE_READWRITE | \
157 PAGE_EXECUTE_WRITECOPY)
159#define PAGE_IS_EXECUTABLE \
161 PAGE_EXECUTE_READ | \
162 PAGE_EXECUTE_READWRITE | \
163 PAGE_EXECUTE_WRITECOPY)
165#define PAGE_IS_WRITECOPY \
167 PAGE_EXECUTE_WRITECOPY)
173#define MM_WAIT_ENTRY 0x7ffffc00
174#elif defined(_M_AMD64)
175#define MM_WAIT_ENTRY 0x7FFFFFFFFFFFFC00ULL
177#error Unsupported architecture!
181#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
182 InterlockedCompareExchange64((PLONG64)(PointerPte), Exchange, Comperand)
184#define InterlockedExchangePte(PointerPte, Value) \
185 InterlockedExchange64((PLONG64)(PointerPte), Value)
187#define InterlockedCompareExchangePte(PointerPte, Exchange, Comperand) \
188 InterlockedCompareExchange((PLONG)(PointerPte), Exchange, Comperand)
190#define InterlockedExchangePte(PointerPte, Value) \
191 InterlockedExchange((PLONG)(PointerPte), Value)
237#define MM_PHYSICALMEMORY_SEGMENT (0x1)
238#define MM_DATAFILE_SEGMENT (0x2)
239#define MM_SEGMENT_INDELETE (0x4)
240#define MM_SEGMENT_INCREATE (0x8)
241#define MM_IMAGE_SECTION_FLUSH_DELETE (0x10)
244#define MA_GetStartingAddress(_MemoryArea) ((_MemoryArea)->VadNode.StartingVpn << PAGE_SHIFT)
245#define MA_GetEndingAddress(_MemoryArea) (((_MemoryArea)->VadNode.EndingVpn + 1) << PAGE_SHIFT)
279#define MI_SET_USAGE(x) MI_PFN_CURRENT_USAGE = x
280#define MI_SET_PROCESS2(x) memcpy(MI_PFN_CURRENT_PROCESS_NAME, x, min(sizeof(x), sizeof(MI_PFN_CURRENT_PROCESS_NAME)))
317#define MI_SET_USAGE(x)
318#define MI_SET_PROCESS(x)
319#define MI_SET_PROCESS2(x)
355#define StartOfAllocation ReadInProgress
356#define EndOfAllocation WriteInProgress
428 CHAR ProcessName[16];
429#define MI_SET_PFN_PROCESS_NAME(pfn, x) memcpy(pfn->ProcessName, x, min(sizeof(x), sizeof(pfn->ProcessName)))
481#define MM_FREE_POOL_SIGNATURE 'ARM3'
580 ULONG AllocationFlags,
581 ULONG AllocationGranularity
597 PVOID FreePageContext
889 while (TotalCommittedPages > PeakCommitment &&
910 ULONG NrAvailablePages,
939#define RMAP_SEGMENT_MASK ~((ULONG_PTR)0xff)
940#define RMAP_IS_SEGMENT(x) (((ULONG_PTR)(x) & RMAP_SEGMENT_MASK) == RMAP_SEGMENT_MASK)
999MiAcquirePfnLock(
VOID)
1020MiAcquirePfnLockAtDpcLevel(
VOID)
1026 KeAcquireQueuedSpinLockAtDpcLevel(LockQueue);
1034MiReleasePfnLockFromDpcLevel(
VOID)
1039 KeReleaseQueuedSpinLockFromDpcLevel(LockQueue);
1043#define MI_ASSERT_PFN_LOCK_HELD() NT_ASSERT((KeGetCurrentIrql() >= DISPATCH_LEVEL) && (MmPfnLock != 0))
1251#define MmSetCleanPage(__P, __A) MmSetDirtyBit(__P, __A, FALSE)
1252#define MmSetDirtyPage(__P, __A) MmSetDirtyBit(__P, __A, TRUE)
1310MmDeletePhysicalMapping(
1363 PVOID* RegionBaseAddress
1368#define PFN_FROM_SSE(E) ((PFN_NUMBER)((E) >> PAGE_SHIFT))
1369#define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
1370#define MM_IS_WAIT_PTE(E) \
1371 (IS_SWAP_FROM_SSE(E) && SWAPENTRY_FROM_SSE(E) == MM_WAIT_ENTRY)
1372#define MAKE_PFN_SSE(P) ((ULONG_PTR)((P) << PAGE_SHIFT))
1373#define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
1374#define MAKE_SWAP_SSE(S) (((ULONG_PTR)(S) << 1) | 0x1)
1375#define DIRTY_SSE(E) ((E) | 2)
1376#define CLEAN_SSE(E) ((E) & ~2)
1377#define IS_DIRTY_SSE(E) ((E) & 2)
1378#define WRITE_SSE(E) ((E) | 4)
1379#define IS_WRITE_SSE(E) ((E) & 4)
1381#define PAGE_FROM_SSE(E) ((E) & 0xFFFFFFF000ULL)
1383#define PAGE_FROM_SSE(E) ((E) & 0xFFFFF000)
1385#define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFC) >> 3)
1386#define MAX_SHARE_COUNT 0x1FF
1387#define MAKE_SSE(P, C) ((ULONG_PTR)((P) | ((C) << 3)))
1388#define BUMPREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) + 1) << 3) | ((E) & 0x7))
1389#define DECREF_SSE(E) (PAGE_FROM_SSE(E) | ((SHARE_COUNT_FROM_SSE(E) - 1) << 3) | ((E) & 0x7))
1397#define MmLockSectionSegment(x) _MmLockSectionSegment(x,__FILE__,__LINE__)
1405#define MmUnlockSectionSegment(x) _MmUnlockSectionSegment(x,__FILE__,__LINE__)
1564MmDereferenceSegmentWithLock(
1600#define MmSetPageEntrySectionSegment(S,O,E) _MmSetPageEntrySectionSegment(S,O,E,__FILE__,__LINE__)
1602#define MmGetPageEntrySectionSegment(S,O) _MmGetPageEntrySectionSegment(S,O,__FILE__,__LINE__)
1752 IN SIZE_T WorkingSetMinimumInBytes,
1753 IN SIZE_T WorkingSetMaximumInBytes,
1787MmSetSessionLocaleId(
1818using MiPfnLockGuard =
const KiQueuedSpinLockGuard<LockQueuePfnLock>;
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
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
#define _Acquires_lock_(lock)
#define _Requires_lock_held_(lock)
#define _Requires_lock_not_held_(lock)
#define _Releases_lock_(lock)
#define _Requires_exclusive_lock_held_(lock)
#define _IRQL_requires_min_(irql)
#define _IRQL_requires_max_(irql)
#define _IRQL_requires_(irql)
#define _IRQL_raises_(irql)
#define PsGetCurrentThread()
#define KeGetCurrentIrql()
#define InterlockedCompareExchangeSizeT(Destination, Exchange, Comperand)
_Must_inspect_result_ _In_ USHORT NewSize
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
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
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeReleaseQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber, IN KIRQL OldIrql)
KIRQL FASTCALL KeAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber)
#define KeGetCurrentThread
#define InterlockedExchangeAddSizeT(a, b)
LIST_ENTRY * ModuleListHead
_In_ NDIS_ERROR_CODE ErrorCode
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
_In_ PMEMORY_AREA MemoryArea
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
#define _Outptr_result_bytebuffer_(s)
struct _EPROCESS * PEPROCESS
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
struct _MMFREE_POOL_ENTRY * PMMFREE_POOL_ENTRY
PMMSUPPORT MmKernelAddressSpace
PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation(PFN_NUMBER Page, PLARGE_INTEGER Offset)
VOID MmShutdownSystem(IN ULONG Phase)
PFN_NUMBER MmResidentAvailablePages
NTSTATUS NTAPI MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
struct _MM_MEMORY_CONSUMER MM_MEMORY_CONSUMER
PMMPAGING_FILE MmPagingFile[MAX_PAGING_FILES]
PFN_NUMBER NTAPI MmAllocPage(ULONG Consumer)
SIZE_T MmTotalPagedPoolQuota
PVOID MmTriageActionTaken
_In_ SIZE_T _Out_ PSIZE_T NewMaxQuota
VOID NTAPI ExpCheckPoolAllocation(PVOID P, POOL_TYPE PoolType, ULONG Tag)
BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
FORCEINLINE PMMSUPPORT MmGetCurrentAddressSpace(VOID)
FORCEINLINE PMMPFN MiGetPfnEntry(IN PFN_NUMBER Pfn)
struct _MMPFNLIST MMPFNLIST
VOID NTAPI MmDeleteKernelStack(PVOID Stack, BOOLEAN GuiStack)
VOID NTAPI MmMakeKernelResourceSectionWritable(VOID)
enum _MI_PFN_USAGES MI_PFN_USAGES
#define MI_SET_PROCESS2(x)
@ MI_USAGE_NONPAGED_POOL_EXPANSION
@ MI_USAGE_LEGACY_PAGE_DIRECTORY
@ MI_USAGE_CONTINOUS_ALLOCATION
@ MI_USAGE_PAGE_DIRECTORY
@ MI_USAGE_KERNEL_STACK_EXPANSION
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
VOID NTAPI MmSetPageProtect(struct _EPROCESS *Process, PVOID Address, ULONG flProtect)
BOOLEAN NTAPI MmIsSessionAddress(IN PVOID Address)
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)
VOID NTAPI MiUnmapPageInHyperSpace(IN PEPROCESS Process, IN PVOID Address, IN KIRQL OldIrql)
struct _MM_PAGED_POOL_INFO * PMM_PAGED_POOL_INFO
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
struct _MM_RMAP_ENTRY *NTAPI MmGetRmapListHeadPage(PFN_NUMBER Page)
VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject)
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)
NTSTATUS NTAPI MmInitializeProcessAddressSpace(IN PEPROCESS Process, IN PEPROCESS Clone OPTIONAL, IN PVOID Section OPTIONAL, IN OUT PULONG Flags, IN POBJECT_NAME_INFORMATION *AuditName OPTIONAL)
VOID NTAPI ExReturnPoolQuota(IN PVOID P)
NTSTATUS NTAPI MiReadPageFile(_In_ PFN_NUMBER Page, _In_ ULONG PageFileIndex, _In_ ULONG_PTR PageFileOffset)
VOID NTAPI MmDereferencePage(PFN_NUMBER Page)
VOID NTAPI MmGetPageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY *SwapEntry)
ULONG NTAPI MmGetPageProtect(struct _EPROCESS *Process, PVOID Address)
SIZE_T MmTotalCommitLimit
struct _MMPFNLIST * PMMPFNLIST
ULONG NTAPI MmGetSessionId(IN PEPROCESS Process)
NTSTATUS NTAPI MmGetFileNameForSection(IN PVOID Section, OUT POBJECT_NAME_INFORMATION *ModuleName)
NTSTATUS NTAPI MmCreateMemoryArea(PMMSUPPORT AddressSpace, ULONG Type, PVOID *BaseAddress, SIZE_T Length, ULONG Protection, PMEMORY_AREA *Result, ULONG AllocationFlags, ULONG AllocationGranularity)
VOID NTAPI MmCleanProcessAddressSpace(IN PEPROCESS Process)
POOL_TYPE NTAPI MmDeterminePoolType(IN PVOID VirtualAddress)
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]
VOID NTAPI MmReferencePage(PFN_NUMBER Page)
_In_ SIZE_T CurrentMaxQuota
SIZE_T MmTotalNonPagedPoolQuota
NTSTATUS NTAPI MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
NTSTATUS NTAPI MmPageFault(ULONG Cs, PULONG Eip, PULONG Eax, ULONG Cr2, ULONG ErrorCode)
ULONG NTAPI MmGetSessionLocaleId(VOID)
NTSTATUS NTAPI MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes, IN SIZE_T WorkingSetMaximumInBytes, IN ULONG SystemCache, IN BOOLEAN IncreaseOkay)
LIST_ENTRY MmLoadedUserImageList
PFN_COUNT MmNumberOfPhysicalPages
NTSTATUS NTAPI MmCreateVirtualMappingUnsafe(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
NTSTATUS NTAPI MmCreateTeb(IN PEPROCESS Process, IN PCLIENT_ID ClientId, IN PINITIAL_TEB InitialTeb, OUT PTEB *BaseTeb)
struct _MM_RMAP_ENTRY * PMM_RMAP_ENTRY
VOID NTAPI MmRebalanceMemoryConsumers(VOID)
PVOID NTAPI MiMapPageInHyperSpace(IN PEPROCESS Process, IN PFN_NUMBER Page, IN PKIRQL OldIrql)
VOID NTAPI MmBuildMdlFromPages(PMDL Mdl, PPFN_NUMBER Pages)
_In_ PVOID _Out_opt_ BOOLEAN * WasDirty
NTSTATUS NTAPI MmFreeMemoryArea(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PMM_FREE_PAGE_FUNC FreePage, PVOID FreePageContext)
VOID NTAPI MiInitializeNonPagedPool(VOID)
FORCEINLINE PFN_NUMBER MiGetPfnEntryIndex(IN PMMPFN Pfn1)
MMPFNLIST MmStandbyPageListHead
#define MmSetCleanPage(__P, __A)
ULONG NTAPI MmGetSessionIdEx(IN PEPROCESS Process)
struct _MEMORY_AREA MEMORY_AREA
VOID NTAPI MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
PFN_COUNT MiFreeSwapPages
BOOLEAN NTAPI MmIsPageSwapEntry(struct _EPROCESS *Process, PVOID Address)
VOID NTAPI _MmUnlockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line)
struct _MM_IMAGE_SECTION_OBJECT MM_IMAGE_SECTION_OBJECT
VOID NTAPI MiRosCheckMemoryAreas(PMMSUPPORT AddressSpace)
VOID NTAPI MmDumpArmPfnDatabase(IN BOOLEAN StatusOnly)
BOOLEAN NTAPI MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject)
VOID NTAPI MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
BOOLEAN NTAPI MmIsDisabledPage(struct _EPROCESS *Process, PVOID Address)
PVOID NTAPI MiAllocatePoolPages(IN POOL_TYPE PoolType, IN SIZE_T SizeInBytes)
BOOLEAN NTAPI MmPurgeSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length)
BOOLEAN NTAPI MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN Dirty, BOOLEAN PageOut, ULONG_PTR *InEntry)
NTSTATUS NTAPI MmQuerySectionView(PMEMORY_AREA MemoryArea, PVOID Address, PMEMORY_BASIC_INFORMATION Info, PSIZE_T ResultLength)
NTSTATUS NTAPI MmProtectSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, SIZE_T Length, ULONG Protect, PULONG OldProtect)
MMPFNLIST MmModifiedPageListHead
struct _MMPAGING_FILE * PMMPAGING_FILE
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
NTSTATUS NTAPI _MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, ULONG_PTR Entry, const char *file, int line)
SWAPENTRY NTAPI MmAllocSwapPage(VOID)
struct _MM_PAGED_POOL_INFO MM_PAGED_POOL_INFO
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
VOID NTAPI MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
struct _MM_IMAGE_SECTION_OBJECT * PMM_IMAGE_SECTION_OBJECT
VOID NTAPI MiRosCleanupMemoryArea(PEPROCESS Process, PMMVAD Vad)
PFN_NUMBER NTAPI MmGetLRUFirstUserPage(VOID)
MMPFNLIST MmZeroedPageListHead
VOID NTAPI MmDeleteProcessAddressSpace(IN PEPROCESS Process)
NTSTATUS MmTrimUserMemory(ULONG Target, ULONG Priority, PULONG NrFreedPages)
NTSTATUS NTAPI MmDbgCopyMemory(IN ULONG64 Address, IN PVOID Buffer, IN ULONG Size, IN ULONG Flags)
VOID NTAPI MmGetImageInformation(OUT PSECTION_IMAGE_INFORMATION ImageInformation)
VOID NTAPI MiUnmapPagesInZeroSpace(IN PVOID VirtualAddress, IN PFN_NUMBER NumberOfPages)
VOID NTAPI MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit)
BOOLEAN NTAPI MmCheckDirtySegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN ForceDirty, BOOLEAN PageOut)
NTSTATUS NTAPI MmCreatePeb(IN PEPROCESS Process, IN PINITIAL_PEB InitialPeb, OUT PPEB *BasePeb)
struct _MM_SECTION_SEGMENT MM_SECTION_SEGMENT
VOID NTAPI MmQuitNextSession(_Inout_ PVOID SessionEntry)
NTSTATUS NTAPI RtlpFindExportedRoutineByName(_In_ PVOID ImageBase, _In_ PCSTR ExportName, _Out_ PVOID *Function, _Out_opt_ PBOOLEAN IsForwarder, _In_ NTSTATUS NotFoundStatus)
ReactOS-only helper routine for RtlFindExportedRoutineByName(), that provides a finer granularity reg...
VOID NTAPI MiInitBalancerThread(VOID)
PVOID MmLastUnloadedDrivers
NTSTATUS NTAPI MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
VOID NTAPI MmInitializeRegion(PLIST_ENTRY RegionListHead, SIZE_T Length, ULONG Type, ULONG Protect)
NTSTATUS NTAPI MmCallDllInitialize(_In_ PLDR_DATA_TABLE_ENTRY LdrEntry, _In_ PLIST_ENTRY ModuleListHead)
NTSTATUS NTAPI MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase)
MM_DRIVER_VERIFIER_DATA MmVerifierData
PMM_REGION NTAPI MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, PVOID *RegionBaseAddress)
VOID NTAPI MmDeleteAllRmaps(PFN_NUMBER Page, PVOID Context, VOID(*DeleteMapping)(PVOID Context, struct _EPROCESS *Process, PVOID Address))
PFN_NUMBER MmLowestPhysicalPage
NTSTATUS NTAPI MmAccessFaultSectionView(PMMSUPPORT AddressSpace, MEMORY_AREA *MemoryArea, PVOID Address, BOOLEAN Locked)
FORCEINLINE VOID UpdateTotalCommittedPages(LONG Delta)
struct _MEMORY_AREA * PMEMORY_AREA
UCHAR MmDisablePagingExecutive
NTSTATUS NTAPI MmUnloadSystemImage(IN PVOID ImageHandle)
BOOLEAN NTAPI MmIsPageInUse(PFN_NUMBER Page)
NTSTATUS NTAPI MmSetExecuteOptions(IN ULONG ExecuteOptions)
PFN_NUMBER NTAPI MmGetPfnForProcess(struct _EPROCESS *Process, PVOID Address)
BOOLEAN NTAPI MmChangeKernelResourceSectionProtection(IN ULONG_PTR ProtectionMask)
MMPFNLIST MmModifiedNoWritePageListHead
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
struct _MM_REGION MM_REGION
PVOID NTAPI MmGetSessionById(_In_ ULONG SessionId)
NTSTATUS NTAPI MmReadFromSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
BOOLEAN NTAPI MmArePagesResident(_In_ PEPROCESS Process, _In_ PVOID BaseAddress, _In_ ULONG Length)
VOID NTAPI MmDeletePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
BOOLEAN NTAPI MmIsSpecialPoolAddress(IN PVOID P)
PVOID NTAPI MiMapPagesInZeroSpace(IN PMMPFN Pfn1, IN PFN_NUMBER NumberOfPages)
NTSTATUS NTAPI MmSetMemoryPriorityProcess(IN PEPROCESS Process, IN UCHAR MemoryPriority)
VOID NTAPI MmDeleteTeb(struct _EPROCESS *Process, PTEB Teb)
BOOLEAN NTAPI MmUseSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag)
VOID NTAPI MmInitializeMemoryConsumer(ULONG Consumer, NTSTATUS(*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed))
VOID(* PMM_FREE_PAGE_FUNC)(PVOID Context, PMEMORY_AREA MemoryArea, PVOID Address, PFN_NUMBER Page, SWAPENTRY SwapEntry, BOOLEAN Dirty)
PFN_NUMBER MmHighestPhysicalPage
NTSTATUS NTAPI MmFlushSegment(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_opt_ PLARGE_INTEGER Offset, _In_ ULONG Length, _Out_opt_ PIO_STATUS_BLOCK Iosb)
SIZE_T MmtotalCommitLimitMaximum
NTSTATUS NTAPI MmExtendSection(_In_ PVOID Section, _Inout_ PLARGE_INTEGER NewSize)
NTSTATUS NTAPI MmInitSectionImplementation(VOID)
FORCEINLINE PEPROCESS MmGetAddressSpaceOwner(IN PMMSUPPORT AddressSpace)
BOOLEAN NTAPI MmIsPagePresent(struct _EPROCESS *Process, PVOID Address)
struct _MMPAGING_FILE MMPAGING_FILE
VOID NTAPI MiInitializeSpecialPool(VOID)
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Page)
VOID NTAPI MmFreeSwapPage(SWAPENTRY Entry)
_Out_ PKAPC_STATE ApcState
VOID NTAPI MmSetSavedSwapEntryPage(PFN_NUMBER Page, SWAPENTRY SavedSwapEntry)
NTSTATUS NTAPI MmGetFileNameForAddress(IN PVOID Address, OUT PUNICODE_STRING ModuleName)
NTSTATUS NTAPI MmAlterRegion(PMMSUPPORT AddressSpace, PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID StartAddress, SIZE_T Length, ULONG NewType, ULONG NewProtect, PMM_ALTER_REGION_FUNC AlterFunc)
NTSTATUS NTAPI MmMakePagesDirty(_In_ PEPROCESS Process, _In_ PVOID Address, _In_ ULONG Length)
VOID NTAPI MmZeroPageThread(VOID)
PVOID NTAPI MmCreateKernelStack(BOOLEAN GuiStack, UCHAR Node)
struct _MM_MEMORY_CONSUMER * PMM_MEMORY_CONSUMER
PFN_NUMBER MmAvailablePages
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
VOID NTAPI _MmLockSectionSegment(PMM_SECTION_SEGMENT Segment, const char *file, int line)
NTSTATUS NTAPI MmPageOutSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID Address, ULONG_PTR Entry)
NTSTATUS NTAPI MmMakeDataSectionResident(_In_ PSECTION_OBJECT_POINTERS SectionObjectPointer, _In_ LONGLONG Offset, _In_ ULONG Length, _In_ PLARGE_INTEGER ValidDataLength)
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Page)
BOOLEAN MiArchCreateProcessAddressSpace(_In_ PEPROCESS Process, _In_ PULONG_PTR DirectoryTableBase)
NTSTATUS NTAPI MmCreatePhysicalMapping(_Inout_opt_ PEPROCESS Process, _In_ PVOID Address, _In_ ULONG flProtect, _In_ PFN_NUMBER Page)
struct _MM_RMAP_ENTRY MM_RMAP_ENTRY
BOOLEAN NTAPI MmIsSpecialPoolAddressFree(IN PVOID P)
PVOID NTAPI MmAllocateSpecialPool(IN SIZE_T NumberOfBytes, IN ULONG Tag, IN POOL_TYPE PoolType, IN ULONG SpecialType)
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
NTSTATUS NTAPI MmCreatePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY SwapEntry)
NTSTATUS NTAPI MmGetExecuteOptions(IN PULONG ExecuteOptions)
NTSTATUS NTAPI MmMapViewInSystemSpaceEx(_In_ PVOID Section, _Outptr_result_bytebuffer_(*ViewSize) PVOID *MappedBase, _Inout_ PSIZE_T ViewSize, _Inout_ PLARGE_INTEGER SectionOffset, _In_ ULONG_PTR Flags)
NTSTATUS NTAPI MmAccessFault(IN ULONG FaultCode, IN PVOID Address, IN KPROCESSOR_MODE Mode, IN PVOID TrapInformation)
VOID NTAPI MmDeleteRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
BOOLEAN NTAPI MmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
VOID NTAPI MmFreeSpecialPool(IN PVOID P)
struct _MM_SECTION_SEGMENT * PMM_SECTION_SEGMENT
ULONG_PTR NTAPI _MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, const char *file, int line)
VOID NTAPI MiCheckAllProcessMemoryAreas(VOID)
VOID NTAPI MmInitializeRmapList(VOID)
PVOID NTAPI MmFindGap(PMMSUPPORT AddressSpace, SIZE_T Length, ULONG_PTR Granularity, BOOLEAN TopDown)
PVOID NTAPI RtlFindExportedRoutineByName(_In_ PVOID ImageBase, _In_ PCSTR ExportName)
Finds the address of a given named exported routine in a loaded image. Note that this function does n...
ULONG MmNumberOfPagingFiles
SIZE_T MmTotalCommittedPages
MMPFNLIST MmFreePageListHead
struct _MMFREE_POOL_ENTRY MMFREE_POOL_ENTRY
PFN_COUNT MiUsedSwapPages
NTSTATUS NTAPI MmCheckSystemImage(IN HANDLE ImageHandle, IN BOOLEAN PurgeSection)
PFN_NUMBER NTAPI MmGetLRUNextUserPage(PFN_NUMBER PreviousPage, BOOLEAN MoveToLast)
ULONG NTAPI MiFreePoolPages(IN PVOID StartingAddress)
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
FORCEINLINE PMMSUPPORT MmGetKernelAddressSpace(VOID)
VOID NTAPI MmInitGlobalKernelPageDirectory(VOID)
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
struct _MMPFNENTRY MMPFNENTRY
BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, IN PEPROCESS Dest, IN PULONG_PTR DirectoryTableBase)
NTSTATUS NTAPI MmPageOutPhysicalAddress(PFN_NUMBER Page)
_In_ SIZE_T QuotaToReturn
PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion(PMMSUPPORT AddressSpace, PVOID Address, SIZE_T Length)
VOID(* PMM_ALTER_REGION_FUNC)(PMMSUPPORT AddressSpace, PVOID BaseAddress, SIZE_T Length, ULONG OldType, ULONG OldProtect, ULONG NewType, ULONG NewProtect)
NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID)
struct _MM_REGION * PMM_REGION
VOID NTAPI MmSetRmapListHeadPage(PFN_NUMBER Page, struct _MM_RMAP_ENTRY *ListHead)
VOID NTAPI MmInitPagingFile(VOID)
#define MI_SET_PROCESS(x)
VOID NTAPI MmDeletePageTable(struct _EPROCESS *Process, PVOID Address)
VOID NTAPI MmShowOutOfSpaceMessagePagingFile(VOID)
VOID NTAPI MmDeleteVirtualMapping(IN PEPROCESS Process, IN PVOID Address, OUT PBOOLEAN WasDirty, OUT PPFN_NUMBER Page)
ULONG MI_PFN_CURRENT_USAGE
CHAR MI_PFN_CURRENT_PROCESS_NAME[16]
static KSPIN_LOCK PspQuotaLock
PLARGE_INTEGER BOOLEAN BOOLEAN PageOut
PLARGE_INTEGER BOOLEAN ForceDirty
PULONG MinorVersion OPTIONAL
base of all file and directory entries
struct _MEMORY_AREA::@1800 SectionData
PMM_SECTION_SEGMENT Segment
LIST_ENTRY RegionListHead
struct _MMFREE_POOL_ENTRY * Owner
UNICODE_STRING PageFileName
PMM_RMAP_ENTRY RmapListHead
SINGLE_LIST_ENTRY NextStackPfn
ULONG_PTR VerifierAllocation
struct _MMPFN * PreviousLRU
struct _MMPFN::@1803::@1809 e2
PMM_SECTION_SEGMENT Segments
SECTION_IMAGE_INFORMATION ImageInformation
NTSTATUS(* Trim)(ULONG Target, ULONG Priority, PULONG NrFreed)
PMMPTE LastPteForPagedPool
SIZE_T AllocatedPagedPool
PRTL_BITMAP EndOfPagedPoolBitmap
PRTL_BITMAP PagedPoolAllocationMap
PMMPDE NextPdeForPagedPoolExpansion
PMMPTE FirstPteForPagedPool
LIST_ENTRY RegionListEntry
struct _MM_RMAP_ENTRY * Next
struct _MM_SECTION_SEGMENT::@1799 Image
RTL_GENERIC_TABLE PageTable
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_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
_Must_inspect_result_ _In_ ULONG Flags
_Use_decl_annotations_ VOID NTAPI MiInitializeWorkingSetList(_Inout_ PMMSUPPORT WorkingSet)
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER _Outptr_ PVOID * TargetAddress
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS SourceAddress
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_Out_ PCLIENT_ID ClientId
_Must_inspect_result_ _Outptr_result_bytebuffer_ ViewSize PVOID * MappedBase
_Must_inspect_result_ _In_ ULONG NewProtect
_In_ KPROCESSOR_MODE PreviousMode
_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