ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID MmFreeCacheSectionPage ( PVOID  Context,
MEMORY_AREA MemoryArea,
PVOID  Address,
PFN_NUMBER  Page,
SWAPENTRY  SwapEntry,
BOOLEAN  Dirty 
)

Definition at line 749 of file data.c.

Referenced by MmUnmapViewOfCacheSegment().

{
    ULONG_PTR Entry;
    PVOID *ContextData = Context;
    PMMSUPPORT AddressSpace;
    PEPROCESS Process;
    PMM_SECTION_SEGMENT Segment;
    LARGE_INTEGER Offset;

    DPRINT("MmFreeSectionPage(%x,%x,%x,%x,%d)\n",
           MmGetAddressSpaceOwner(ContextData[0]),
           Address,
           Page,
           SwapEntry,
           Dirty);

    AddressSpace = ContextData[0];
    Process = MmGetAddressSpaceOwner(AddressSpace);
    Address = (PVOID)PAGE_ROUND_DOWN(Address);
    Segment = ContextData[1];
    Offset.QuadPart = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress +
                      MemoryArea->Data.SectionData.ViewOffset.QuadPart;

    Entry = MmGetPageEntrySectionSegment(Segment, &Offset);

    if (Page != 0 && PFN_FROM_SSE(Entry) == Page && Dirty)
    {
        DPRINT("Freeing section page %x:%x -> %x\n", Segment, Offset.LowPart, Entry);
        MmSetPageEntrySectionSegment(Segment, &Offset, DIRTY_SSE(Entry));
    }
    if (Page)
    {
        DPRINT("Removing page %x:%x -> %x\n", Segment, Offset.LowPart, Entry);
        MmSetSavedSwapEntryPage(Page, 0);
        MmDeleteRmap(Page, Process, Address);
        MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
        MmReleasePageMemoryConsumer(MC_CACHE, Page);
    }
    if (SwapEntry != 0)
    {
        MmFreeSwapPage(SwapEntry);
    }
}

Generated on Sun May 27 2012 05:25:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.