ReactOS  0.4.13-dev-99-g7e18b6d
sptab.c File Reference
#include <ntoskrnl.h>
#include "newmm.h"
#include <debug.h>
Include dependency graph for sptab.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define DPRINTC   DPRINT
 

Functions

 _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)
 

Variables

KSPIN_LOCK MiSectionPageTableLock
 

Macro Definition Documentation

◆ DPRINTC

#define DPRINTC   DPRINT

Definition at line 61 of file sptab.c.

◆ NDEBUG

#define NDEBUG

Definition at line 58 of file sptab.c.

Function Documentation

◆ _Function_class_() [1/3]

_Function_class_ ( RTL_GENERIC_ALLOCATE_ROUTINE  )

Definition at line 67 of file sptab.c.

72 {
73  PVOID Result;
75  //DPRINT("MiSectionPageTableAllocate(%d) => %p\n", Bytes, Result);
76  return Result;
77 }
_In_ UINT Bytes
Definition: mmcopy.h:9
_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 ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350

◆ _Function_class_() [2/3]

_Function_class_ ( RTL_GENERIC_FREE_ROUTINE  )

Definition at line 79 of file sptab.c.

84 {
85  //DPRINT("MiSectionPageTableFree(%p)\n", Data);
86  ExFreePoolWithTag(Data, 'tPmM');
87 }
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

◆ _Function_class_() [3/3]

_Function_class_ ( RTL_GENERIC_COMPARE_ROUTINE  )

Definition at line 89 of file sptab.c.

96 {
97  PLARGE_INTEGER A = PtrA, B = PtrB;
98  BOOLEAN Result = (A->QuadPart < B->QuadPart) ? GenericLessThan :
99  (A->QuadPart == B->QuadPart) ? GenericEqual : GenericGreaterThan;
100 
101 #if 0
102  DPRINT
103  ("Compare: %08x%08x vs %08x%08x => %s\n",
104  A->u.HighPart, A->u.LowPart,
105  B->u.HighPart, B->u.LowPart,
106  Result == GenericLessThan ? "GenericLessThan" :
107  Result == GenericGreaterThan ? "GenericGreaterThan" :
108  "GenericEqual");
109 #endif
110 
111  return Result;
112 }
unsigned char BOOLEAN
_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
void DPRINT(...)
Definition: polytest.cpp:61
Definition: ttei1.cpp:12
#define B(row, col)

◆ _MmGetPageEntrySectionSegment()

ULONG_PTR NTAPI _MmGetPageEntrySectionSegment ( PMM_SECTION_SEGMENT  Segment,
PLARGE_INTEGER  Offset,
const char file,
int  line 
)

Definition at line 237 of file sptab.c.

241 {
243  ULONG_PTR PageIndex, Result;
245 
246  ASSERT(Segment->Locked);
247  FileOffset.QuadPart = ROUND_DOWN(Offset->QuadPart,
250  if (!PageTable) return 0;
251  PageIndex = (ULONG_PTR)((Offset->QuadPart - PageTable->FileOffset.QuadPart) / PAGE_SIZE);
252  Result = PageTable->PageEntries[PageIndex];
253 #if 0
254  DPRINTC
255  ("MiGetPageEntrySectionSegment(%p,%08x%08x) => %x %s:%d\n",
256  Segment,
257  FileOffset.u.HighPart,
258  FileOffset.u.LowPart + PageIndex * PAGE_SIZE,
259  Result,
260  file, line);
261 #endif
262  return Result;
263 }
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:40
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
Definition: sptab.c:117
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_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
Definition: parser.c:48
_Inout_ PVOID Segment
Definition: exfuncs.h:893
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define ROUND_DOWN(n, align)
Definition: eventvwr.h:30
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
#define ULONG_PTR
Definition: config.h:101
#define DPRINTC
Definition: sptab.c:61
#define ENTRIES_PER_ELEMENT
Definition: newmm.h:49
Definition: fci.c:126

◆ _MmSetPageEntrySectionSegment()

NTSTATUS NTAPI _MmSetPageEntrySectionSegment ( PMM_SECTION_SEGMENT  Segment,
PLARGE_INTEGER  Offset,
ULONG_PTR  Entry,
const char file,
int  line 
)

Definition at line 178 of file sptab.c.

183 {
184  ULONG_PTR PageIndex, OldEntry;
186 
187  ASSERT(Segment->Locked);
189 
190  if (Entry && !IS_SWAP_FROM_SSE(Entry))
192 
194 
195  if (!PageTable) return STATUS_NO_MEMORY;
196 
198 
199  PageTable->Segment = Segment;
200  PageIndex = (ULONG_PTR)((Offset->QuadPart - PageTable->FileOffset.QuadPart) / PAGE_SIZE);
201  OldEntry = PageTable->PageEntries[PageIndex];
202 
203  DPRINT("MiSetPageEntrySectionSegment(%p,%08x%08x,%x=>%x)\n",
204  Segment,
205  Offset->u.HighPart,
206  Offset->u.LowPart,
207  OldEntry,
208  Entry);
209 
210  if (PFN_FROM_SSE(Entry) == PFN_FROM_SSE(OldEntry)) {
211  /* Nothing */
212  } else if (Entry && !IS_SWAP_FROM_SSE(Entry)) {
213  ASSERT(!OldEntry || IS_SWAP_FROM_SSE(OldEntry));
215  } else if (OldEntry && !IS_SWAP_FROM_SSE(OldEntry)) {
218  } else if (IS_SWAP_FROM_SSE(Entry)) {
219  ASSERT(!IS_SWAP_FROM_SSE(OldEntry) ||
220  SWAPENTRY_FROM_SSE(OldEntry) == MM_WAIT_ENTRY);
221  if (OldEntry && SWAPENTRY_FROM_SSE(OldEntry) != MM_WAIT_ENTRY)
223  } else if (IS_SWAP_FROM_SSE(OldEntry)) {
225  if (Entry)
227  } else {
228  /* We should not be replacing a page like this */
229  ASSERT(FALSE);
230  }
231  PageTable->PageEntries[PageIndex] = Entry;
232  return STATUS_SUCCESS;
233 }
#define IS_DIRTY_SSE(E)
Definition: newmm.h:16
struct _Entry Entry
Definition: kefuncs.h:640
#define PFN_FROM_SSE(E)
Definition: newmm.h:7
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:40
struct _MM_RMAP_ENTRY *NTAPI MmGetRmapListHeadPage(PFN_NUMBER Page)
Definition: freelist.c:427
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
Definition: sptab.c:117
#define MM_WAIT_ENTRY
Definition: mm.h:152
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGetOrAllocate(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
Definition: sptab.c:136
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
VOID NTAPI MmDeleteSectionAssociation(PFN_NUMBER Page)
Definition: rmap.c:484
void DPRINT(...)
Definition: polytest.cpp:61
_Inout_ PVOID Segment
Definition: exfuncs.h:893
#define SWAPENTRY_FROM_SSE(E)
Definition: newmm.h:12
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
NTSTATUS NTAPI MmSetSectionAssociation(PFN_NUMBER Page, PMM_SECTION_SEGMENT Segment, PLARGE_INTEGER Offset)
Definition: sptab.c:352
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define IS_SWAP_FROM_SSE(E)
Definition: newmm.h:8
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define ULONG_PTR
Definition: config.h:101
return STATUS_SUCCESS
Definition: btrfs.c:2725
base of all file and directory entries
Definition: entries.h:82

◆ MiInitializeSectionPageTable()

VOID NTAPI MiInitializeSectionPageTable ( PMM_SECTION_SEGMENT  Segment)

Definition at line 165 of file sptab.c.

166 {
168  MiSectionPageTableCompare,
169  MiSectionPageTableAllocate,
170  MiSectionPageTableFree,
171  NULL);
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)
Definition: generictable.c:100
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
_Inout_ PVOID Segment
Definition: exfuncs.h:893

Referenced by ExeFmtpCreateImageSection(), MmCreateCacheSection(), MmCreateDataFileSection(), and MmCreatePageFileSection().

◆ MiSectionPageTableGet()

static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet ( PRTL_GENERIC_TABLE  Table,
PLARGE_INTEGER  FileOffset 
)
static

Definition at line 117 of file sptab.c.

119 {
120  LARGE_INTEGER SearchFileOffset;
122  SearchFileOffset.QuadPart = ROUND_DOWN(FileOffset->QuadPart,
124  PageTable = RtlLookupElementGenericTable(Table, &SearchFileOffset);
125 
126  DPRINT("MiSectionPageTableGet(%p,%I64x)\n",
127  Table,
128  FileOffset->QuadPart);
129 
130  return PageTable;
131 }
ASMGENDATA Table[]
Definition: genincdata.c:61
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:40
void DPRINT(...)
Definition: polytest.cpp:61
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlLookupElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define ROUND_DOWN(n, align)
Definition: eventvwr.h:30
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
LONGLONG QuadPart
Definition: typedefs.h:112
#define ENTRIES_PER_ELEMENT
Definition: newmm.h:49

Referenced by _MmGetPageEntrySectionSegment(), _MmSetPageEntrySectionSegment(), MiSectionPageTableGetOrAllocate(), and MmSetSectionAssociation().

◆ MiSectionPageTableGetOrAllocate()

static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGetOrAllocate ( PRTL_GENERIC_TABLE  Table,
PLARGE_INTEGER  FileOffset 
)
static

Definition at line 136 of file sptab.c.

138 {
139  LARGE_INTEGER SearchFileOffset;
140  CACHE_SECTION_PAGE_TABLE SectionZeroPageTable;
142  FileOffset);
143  /* Please zero memory when taking away zero initialization. */
144  RtlZeroMemory(&SectionZeroPageTable, sizeof(CACHE_SECTION_PAGE_TABLE));
145  if (!PageTableSlice)
146  {
147  SearchFileOffset.QuadPart = ROUND_DOWN(FileOffset->QuadPart,
149  SectionZeroPageTable.FileOffset = SearchFileOffset;
150  SectionZeroPageTable.Refcount = 1;
151  PageTableSlice = RtlInsertElementGenericTable(Table,
152  &SectionZeroPageTable,
153  sizeof(SectionZeroPageTable),
154  NULL);
155  if (!PageTableSlice) return NULL;
156  DPRINT("Allocate page table %p (%I64x)\n",
157  PageTableSlice,
158  PageTableSlice->FileOffset.QuadPart);
159  }
160  return PageTableSlice;
161 }
ASMGENDATA Table[]
Definition: genincdata.c:61
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
Definition: sptab.c:117
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
LARGE_INTEGER FileOffset
Definition: newmm.h:55
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define ROUND_DOWN(n, align)
Definition: eventvwr.h:30
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
NTSYSAPI PVOID NTAPI RtlInsertElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_reads_bytes_(BufferSize) PVOID Buffer, _In_ CLONG BufferSize, _Out_opt_ PBOOLEAN NewElement)
LONGLONG QuadPart
Definition: typedefs.h:112
#define ENTRIES_PER_ELEMENT
Definition: newmm.h:49

Referenced by _MmSetPageEntrySectionSegment().

◆ MmFreePageTablesSectionSegment()

VOID NTAPI MmFreePageTablesSectionSegment ( PMM_SECTION_SEGMENT  Segment,
FREE_SECTION_PAGE_FUN  FreePage 
)

Definition at line 278 of file sptab.c.

280 {
282  DPRINT("MiFreePageTablesSectionSegment(%p)\n", &Segment->PageTable);
283  while ((Element = RtlGetElementGenericTable(&Segment->PageTable, 0))) {
284  DPRINT("Delete table for <%wZ> %p -> %I64x\n",
285  Segment->FileObject ? &Segment->FileObject->FileName : NULL,
286  Segment,
287  Element->FileOffset.QuadPart);
288  if (FreePage)
289  {
290  ULONG i;
291  for (i = 0; i < ENTRIES_PER_ELEMENT; i++)
292  {
295  Offset.QuadPart = Element->FileOffset.QuadPart + i * PAGE_SIZE;
296  Entry = Element->PageEntries[i];
297  if (Entry && !IS_SWAP_FROM_SSE(Entry))
298  {
299  DPRINT("Freeing page %p:%Ix @ %I64x\n",
300  Segment,
301  Entry,
302  Offset.QuadPart);
303 
305  }
306  }
307  }
308  DPRINT("Remove memory\n");
309  RtlDeleteElementGenericTable(&Segment->PageTable, Element);
310  }
311  DPRINT("Done\n");
312 }
struct _Entry Entry
Definition: kefuncs.h:640
uint32_t ULONG_PTR
Definition: typedefs.h:63
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
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
ULONG_PTR PageEntries[ENTRIES_PER_ELEMENT]
Definition: newmm.h:58
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
_Inout_ PVOID Segment
Definition: exfuncs.h:893
_Must_inspect_result_ NTSYSAPI PVOID NTAPI RtlGetElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ ULONG I)
LARGE_INTEGER FileOffset
Definition: newmm.h:55
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define IS_SWAP_FROM_SSE(E)
Definition: newmm.h:8
NTSYSAPI BOOLEAN NTAPI RtlDeleteElementGenericTable(_In_ PRTL_GENERIC_TABLE Table, _In_ PVOID Buffer)
unsigned int ULONG
Definition: retypes.h:1
base of all file and directory entries
Definition: entries.h:82
LONGLONG QuadPart
Definition: typedefs.h:112
#define ENTRIES_PER_ELEMENT
Definition: newmm.h:49

Referenced by MmFinalizeSegment(), MmFreeSectionSegments(), and MmpDeleteSection().

◆ MmGetSectionAssociation()

PMM_SECTION_SEGMENT NTAPI MmGetSectionAssociation ( PFN_NUMBER  Page,
PLARGE_INTEGER  Offset 
)

Definition at line 331 of file sptab.c.

333 {
334  ULONG RawOffset;
337 
339  &RawOffset);
340  if (PageTable)
341  {
342  Segment = PageTable->Segment;
343  Offset->QuadPart = PageTable->FileOffset.QuadPart +
344  ((ULONG64)RawOffset << PAGE_SHIFT);
345  }
346 
347  return Segment;
348 }
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
PVOID NTAPI MmGetSegmentRmap(PFN_NUMBER Page, PULONG RawOffset)
Definition: rmap.c:451
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:40
struct _CACHE_SECTION_PAGE_TABLE * PCACHE_SECTION_PAGE_TABLE
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PVOID Segment
Definition: exfuncs.h:893
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned int ULONG
Definition: retypes.h:1

Referenced by MmpPageOutPhysicalAddress().

◆ MmSetSectionAssociation()

NTSTATUS NTAPI MmSetSectionAssociation ( PFN_NUMBER  Page,
PMM_SECTION_SEGMENT  Segment,
PLARGE_INTEGER  Offset 
)

Definition at line 352 of file sptab.c.

355 {
357  ULONG ActualOffset;
358 
360  ASSERT(PageTable);
361 
362  ActualOffset = (ULONG)(Offset->QuadPart - PageTable->FileOffset.QuadPart);
363  MmInsertRmap(Page,
365  (PVOID)(RMAP_SEGMENT_MASK | (ActualOffset >> PAGE_SHIFT)));
366 
367  return STATUS_SUCCESS;
368 }
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
VOID NTAPI MmInsertRmap(PFN_NUMBER Page, struct _EPROCESS *Process, PVOID Address)
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:40
static PCACHE_SECTION_PAGE_TABLE NTAPI MiSectionPageTableGet(PRTL_GENERIC_TABLE Table, PLARGE_INTEGER FileOffset)
Definition: sptab.c:117
#define RMAP_SEGMENT_MASK
Definition: newmm.h:24
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_Inout_ PVOID Segment
Definition: exfuncs.h:893
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2725

Referenced by _MmSetPageEntrySectionSegment().

Variable Documentation

◆ MiSectionPageTableLock

KSPIN_LOCK MiSectionPageTableLock