52{
62
63GetEntry:
65
67
70
72 {
74 goto WriteSegment;
75 }
76
79
81 {
83 }
84
85
87
89 {
92 }
93
97 {
100 }
102
104
107 {
111 goto GetEntry;
112 }
113
114
115
119
121 {
122
128 goto GetEntry;
129 }
130
132 {
139
142
144
146
149 {
150
158 }
159
160
163 if (!Unmapped || (MapPage !=
Page))
164 {
165
166
167
168
173 __LINE__);
174 }
175
177 {
179
180
182
183
185
186 if ((SwapEntry == 0) && Dirty)
187 {
188
190 if (!SwapEntry)
191 {
195
196
200
206
208 }
209 }
210
211 if (Dirty)
212 {
214
215
218
220
223 ASSERT(Dummy == MM_WAIT_ENTRY);
224
226 {
227
231
232
235
236
240
246
248 }
249 }
250
251 if (SwapEntry)
252 {
253
256 }
257
258
262#if DBG
266#endif
268
271
273 }
274
275
277
282
285
287 }
288#ifdef NEWCC
289 else if (
Type == MEMORY_AREA_CACHE)
290 {
291
294 }
295#endif
296 else
297 {
299 }
300
301WriteSegment:
302
305 {
307
309
311
314
315 if (Released)
316 {
318 }
319 }
320
321
323}
#define NT_SUCCESS(StatCode)
#define ExReleaseRundownProtection
#define ExAcquireRundownProtection
_In_ PMEMORY_AREA MemoryArea
NTSTATUS NTAPI MmpPageOutPhysicalAddress(PFN_NUMBER Page)
#define PROCESS_ALL_ACCESS
_In_ ULONG _In_ ULONG Offset
#define MmSystemRangeStart
#define MmSetDirtyPage(__P, __A)
#define MmGetPageEntrySectionSegment(S, O)
FORCEINLINE VOID MmLockAddressSpace(PMMSUPPORT AddressSpace)
#define MmLockSectionSegment(x)
#define MmUnlockSectionSegment(x)
BOOLEAN NTAPI MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, BOOLEAN Dirty, BOOLEAN PageOut, ULONG_PTR *InEntry)
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)
#define MA_GetStartingAddress(_MemoryArea)
FORCEINLINE VOID MmUnlockAddressSpace(PMMSUPPORT AddressSpace)
VOID NTAPI MmDeletePageFileMapping(struct _EPROCESS *Process, PVOID Address, SWAPENTRY *SwapEntry)
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 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
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address)
VOID NTAPI MmDeleteRmap(PFN_NUMBER Page, PEPROCESS Process, PVOID Address)
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
#define STATUS_UNSUCCESSFUL
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
#define ObDereferenceObject
#define PsGetCurrentProcess