#include <ntoskrnl.h>
#include "newmm.h"
#include <debug.h>
Go to the source code of this file.
|
| | _Function_class_ (RTL_GENERIC_ALLOCATE_ROUTINE) |
| |
| | _Function_class_ (RTL_GENERIC_FREE_ROUTINE) |
| |
| | _Function_class_ (RTL_GENERIC_COMPARE_ROUTINE) |
| |
| static PCACHE_SECTION_PAGE_TABLE NTAPI | MiSectionPageTableGet (PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset) |
| |
| static PCACHE_SECTION_PAGE_TABLE NTAPI | MiSectionPageTableGetOrAllocate (PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset) |
| |
| VOID NTAPI | MiInitializeSectionPageTable (PMM_SECTION_SEGMENT Segment) |
| |
| NTSTATUS NTAPI | _MmSetPageEntrySectionSegment (PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, ULONG_PTR Entry, const char *file, int line) |
| |
| ULONG_PTR NTAPI | _MmGetPageEntrySectionSegment (PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset, const char *file, int line) |
| |
| VOID NTAPI | MmFreePageTablesSectionSegment (PMM_SECTION_SEGMENT Segment, FREE_SECTION_PAGE_FUN FreePage) |
| |
| PMM_SECTION_SEGMENT NTAPI | MmGetSectionAssociation (PFN_NUMBER Page, PLARGE_INTEGER Offset) |
| |
| NTSTATUS NTAPI | MmSetSectionAssociation (PFN_NUMBER Page, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset) |
| |
◆ DPRINTC
◆ NDEBUG
◆ _Function_class_() [1/3]
| _Function_class_ |
( |
RTL_GENERIC_ALLOCATE_ROUTINE |
| ) |
|
Definition at line 67 of file sptab.c.
72{
75
77}
#define ExAllocatePoolWithTag(hernya, size, tag)
_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
◆ _Function_class_() [2/3]
| _Function_class_ |
( |
RTL_GENERIC_COMPARE_ROUTINE |
| ) |
|
Definition at line 89 of file sptab.c.
96{
100
101#if 0
103 ("Compare: %08x%08x vs %08x%08x => %s\n",
104 A->u.HighPart,
A->u.LowPart,
105 B->u.HighPart,
B->u.LowPart,
108 "GenericEqual");
109#endif
110
112}
◆ _Function_class_() [3/3]
| _Function_class_ |
( |
RTL_GENERIC_FREE_ROUTINE |
| ) |
|
Definition at line 79 of file sptab.c.
84{
85
87}
#define ExFreePoolWithTag(_P, _T)
◆ _MmGetPageEntrySectionSegment()
Definition at line 280 of file sptab.c.
284{
288
296#if 0
298 ("MiGetPageEntrySectionSegment(%p,%08x%08x) => %x %s:%d\n",
304#endif
306}
_In_ PFCB _In_ LONGLONG FileOffset
#define ROUND_DOWN(n, align)
#define ENTRIES_PER_ELEMENT
_In_ ULONG _In_ ULONG Offset
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
static PMEM_HOOK PageTable[TOTAL_PAGES]
◆ _MmSetPageEntrySectionSegment()
Definition at line 178 of file sptab.c.
183{
186
189
191
193
195
198 OldEntry =
PageTable->PageEntries[PageIndex];
199
200 DPRINT(
"MiSetPageEntrySectionSegment(%p,%08x%08x,%x=>%x)\n",
204 OldEntry,
206
207
208 if (
Entry && !OldEntry)
209 {
211 }
212 if (OldEntry && !
Entry)
213 {
215 }
216
218 {
219
221 {
222
224 {
226
227
228
230
232 }
233 else
234 {
236 }
237 }
238 else
239 {
240
241
242
243
246
249 }
250 }
252 {
253
256
258 {
259
261 {
266 break;
267 }
268 }
269 }
270 else
271 {
273 }
274
276}
#define InterlockedIncrement64(a)
VOID NTAPI MmDeleteSectionAssociation(PFN_NUMBER Page)
#define MmGetPageEntrySectionSegment(S, O)
#define IS_SWAP_FROM_SSE(E)
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGetOrAllocate(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
NTSTATUS NTAPI MmSetSectionAssociation(PFN_NUMBER Page, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset)
◆ MiInitializeSectionPageTable()
Definition at line 165 of file sptab.c.
166{
168 MiSectionPageTableCompare,
169 MiSectionPageTableAllocate,
170 MiSectionPageTableFree,
172
173 DPRINT(
"MiInitializeSectionPageTable(%p)\n", &
Segment->PageTable);
174}
VOID NTAPI RtlInitializeGenericTable(IN PRTL_GENERIC_TABLE Table, IN PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, IN PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, IN PRTL_GENERIC_FREE_ROUTINE FreeRoutine, IN PVOID TableContext)
Referenced by ExeFmtpCreateImageSection(), MmCreateDataFileSection(), and MmCreatePhysicalMemorySection().
◆ MiSectionPageTableGet()
◆ MiSectionPageTableGetOrAllocate()
Definition at line 136 of file sptab.c.
138{
143
145 if (!PageTableSlice)
146 {
149 SectionZeroPageTable.
FileOffset = SearchFileOffset;
152 &SectionZeroPageTable,
153 sizeof(SectionZeroPageTable),
155 if (!PageTableSlice)
return NULL;
156 DPRINT(
"Allocate page table %p (%I64x)\n",
157 PageTableSlice,
159 }
160 return PageTableSlice;
161}
#define RtlZeroMemory(Destination, Length)
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
Referenced by _MmSetPageEntrySectionSegment().
◆ MmFreePageTablesSectionSegment()
Definition at line 321 of file sptab.c.
323{
325 DPRINT(
"MiFreePageTablesSectionSegment(%p)\n", &
Segment->PageTable);
327 DPRINT(
"Delete table for <%wZ> %p -> %I64x\n",
332 {
335 {
341 {
342 DPRINT(
"Freeing page %p:%Ix @ %I64x\n",
346
348 }
349 }
350 }
351 DPRINT(
"Remove memory\n");
353 }
355}
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
ULONG_PTR PageEntries[ENTRIES_PER_ELEMENT]
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlGetElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ ULONG I)
Referenced by _When_().
◆ MmGetSectionAssociation()
◆ MmSetSectionAssociation()
Definition at line 400 of file sptab.c.
403{
406
409
414
416}
#define RMAP_SEGMENT_MASK
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
Referenced by _MmSetPageEntrySectionSegment().
◆ MiSectionPageTableLock