163 if (!Unmapped || (MapPage !=
Page))
186 if ((SwapEntry == 0) && Dirty)
223 ASSERT(Dummy == MM_WAIT_ENTRY);
289 else if (
Type == MEMORY_AREA_CACHE)
339 if (new_entry ==
NULL)
353 DPRINT1(
"Insert rmap (%d, 0x%.8X) 0x%.8X which doesn't match physical "
368 previous_entry = current_entry;
369 current_entry = current_entry->
Next;
377 previous_entry = current_entry;
378 current_entry = current_entry->
Next;
385 DbgPrint(
"MmInsertRmap tries to add a second rmap entry for address %p\n", current_entry->
Address);
386 DbgPrint(
" current caller %p\n", new_entry->Caller);
387 DbgPrint(
" previous caller %p\n", current_entry->Caller);
392 new_entry->
Next = current_entry;
394 previous_entry->
Next = new_entry;
404 if (PrevSize >=
Process->Vm.PeakWorkingSetSize)
420 previous_entry =
NULL;
423 while (current_entry !=
NULL)
428 if (previous_entry ==
NULL)
434 previous_entry->
Next = current_entry->
Next;
446 previous_entry = current_entry;
447 current_entry = current_entry->
Next;
478 while (current_entry !=
NULL)
492 current_entry = current_entry->
Next;
511 previous_entry =
NULL;
513 while (current_entry !=
NULL)
517 if (previous_entry ==
NULL)
523 previous_entry->
Next = current_entry->
Next;
529 previous_entry = current_entry;
530 current_entry = current_entry->
Next;
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
#define NT_SUCCESS(StatCode)
#define __drv_freesMem(kind)
#define _IRQL_requires_max_(irql)
#define KeGetCurrentIrql()
#define ExReleaseRundownProtection
#define InterlockedExchangeAddUL(Addend, Value)
#define ExAcquireRundownProtection
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
#define ExFreePoolWithTag(_P, _T)
#define PAGE_ROUND_DOWN(x)
_In_ PMEMORY_AREA MemoryArea
NTSTATUS NTAPI MmpPageOutPhysicalAddress(PFN_NUMBER Page)
struct _CACHE_SECTION_PAGE_TABLE * PCACHE_SECTION_PAGE_TABLE
#define PROCESS_ALL_ACCESS
struct _EPROCESS * PEPROCESS
_In_ ULONG _In_ ULONG Offset
#define MmSystemRangeStart
#define MmSetDirtyPage(__P, __A)
#define MmGetPageEntrySectionSegment(S, O)
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
struct _MM_RMAP_ENTRY *NTAPI MmGetRmapListHeadPage(PFN_NUMBER Page)
#define MmLockSectionSegment(x)
#define MmUnlockSectionSegment(x)
#define RMAP_IS_SEGMENT(x)
BOOLEAN NTAPI MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN Dirty, BOOLEAN PageOut, ULONG_PTR *InEntry)
_In_ PVOID _Out_opt_ BOOLEAN _Out_opt_ PPFN_NUMBER Page
SWAPENTRY NTAPI MmAllocSwapPage(VOID)
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
BOOLEAN NTAPI MmCheckDirtySegment(PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN ForceDirty, BOOLEAN PageOut)
NTSTATUS NTAPI MmWriteToSwapPage(SWAPENTRY SwapEntry, PFN_NUMBER Page)
PMM_REGION NTAPI MmFindRegion(PVOID BaseAddress, PLIST_ENTRY RegionListHead, PVOID Address, PVOID *RegionBaseAddress)
PFN_NUMBER NTAPI MmGetPfnForProcess(struct _EPROCESS *Process, PVOID Address)
#define MA_GetStartingAddress(_MemoryArea)
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
VOID NTAPI MmDeletePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
#define MM_SEGMENT_INDELETE
VOID NTAPI MmFreeSwapPage(SWAPENTRY Entry)
VOID NTAPI MmSetSavedSwapEntryPage(PFN_NUMBER Page, SWAPENTRY SavedSwapEntry)
#define MEMORY_AREA_SECTION_VIEW
SWAPENTRY NTAPI MmGetSavedSwapEntryPage(PFN_NUMBER Page)
NTSTATUS NTAPI MmCreateVirtualMapping(struct _EPROCESS *Process, PVOID Address, ULONG flProtect, PFN_NUMBER Page)
NTSTATUS NTAPI MmCreatePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY SwapEntry)
#define MM_IS_WAIT_PTE(E)
NTSTATUS NTAPI MmReleasePageMemoryConsumer(ULONG Consumer, PFN_NUMBER Page)
VOID NTAPI MmSetRmapListHeadPage(PFN_NUMBER Page, struct _MM_RMAP_ENTRY *ListHead)
VOID NTAPI MmDeleteVirtualMapping(IN PEPROCESS Process, IN PVOID Address, OUT PBOOLEAN WasDirty, OUT PPFN_NUMBER Page)
#define STATUS_PROCESS_IS_TERMINATING
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
VOID NTAPI KeDetachProcess(VOID)
VOID NTAPI KeAttachProcess(IN PKPROCESS Process)
PEPROCESS PsInitialSystemProcess
static NPAGED_LOOKASIDE_LIST RmapLookasideList
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address)
VOID NTAPI MmDeleteRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address)
PVOID NTAPI MmGetSegmentRmap(PFN_NUMBER Page, PULONG RawOffset)
VOID NTAPI MmDeleteSectionAssociation(PFN_NUMBER Page)
VOID NTAPI MmInitializeRmapList(VOID)
NTSTATUS NTAPI MmPageOutPhysicalAddress(PFN_NUMBER Page)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation(PFN_NUMBER Page, PLARGE_INTEGER Offset)
base of all file and directory entries
struct _MEMORY_AREA::@1796 SectionData
struct _MM_RMAP_ENTRY * Next
#define STATUS_UNSUCCESSFUL
_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
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define ObDereferenceObject
#define PsGetCurrentProcess