Author: fireball
Date: Tue Oct 20 11:53:29 2009
New Revision: 43640
URL:
http://svn.reactos.org/svn/reactos?rev=43640&view=rev
Log:
[ntoskrnl/mm/ARM3]
- Rewrite MmPageEntireDriver in a better way, fix bugs.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/drvmgmt.c [iso-8859-1] Tue Oct 20 11:53:29 2009
@@ -116,32 +116,40 @@
NTAPI
MmPageEntireDriver(IN PVOID AddressWithinSection)
{
+ PAGED_CODE();
//
// We should find the driver loader entry and return its base address
//
- //PMMPTE Pte;
- PLDR_DATA_TABLE_ENTRY pLdrDataTabEntry =
MiLookupDataTableEntry(AddressWithinSection);
+ //PMMPTE StartPte, EndPte;
+ PLDR_DATA_TABLE_ENTRY pLdrDataTabEntry =
+ MiLookupDataTableEntry(AddressWithinSection);
if (pLdrDataTabEntry)
{
//
- // Is Paging Disabled or Check if we had already mapped it in for this section
- //
- if ( (MmDisablePagingExecutive & 1) || pLdrDataTabEntry->SectionPointer )
- {
+ // Is Paging disabled or it's mapped as an image
+ //
+ if ((MmDisablePagingExecutive & 1) || pLdrDataTabEntry->SectionPointer)
return pLdrDataTabEntry->DllBase;
- }
+
//
// Flush all queued DPCs.
//
KeFlushQueuedDpcs();
- //
- // Get the PTE for this section
- //
- //Pte = MiGetPteAddress(pLdrDataTabEntry->DllBase);
- //
- //MiSetPagingOfDriver( (Pte & (4,194,304 - 4) ) - 0x40000000 ,
- // (Pte & (4,194,304 - 4) ) - 0x40000000 + 4 *
- // pLdrDataTabEntry->SizeOfImage >>
PAGE_SHIFT - 4 );
+
+ //
+ // Get PTE range for this section
+ //
+ //StartPte = MiGetPteAddress(pLdrDataTabEntry->DllBase);
+ //EndPte = MiGetPteAddress(pLdrDataTabEntry->DllBase +
+ // pLdrDataTabEntry->SizeOfImage);
+
+ //
+ // Set paging for specified PTE range
+ //
+ //MiSetPagingOfDriver(StartPte, EndPte);
+
+ //
+ // Return base address
//
return pLdrDataTabEntry->DllBase;
}