- We need to call MmMarkPageMapped for virtual mappings, except for those created thgouh MmCreateVirtualMappingForKernel (even though the other versions of the call can still do kernel mappings).

- Refactored the virtual mapping function to support this. MmUnmapIoSpace now works properly.

svn path=/trunk/; revision=34667
This commit is contained in:
ReactOS Portable Systems Group 2008-07-22 09:31:13 +00:00
parent 6c50287599
commit 4cdbf59086

View file

@ -480,10 +480,11 @@ MmIsPageSwapEntry(IN PEPROCESS Process,
NTSTATUS
NTAPI
MmCreateVirtualMappingForKernel(IN PVOID Address,
IN ULONG Protection,
IN PPFN_NUMBER Pages,
IN ULONG PageCount)
MmCreateVirtualMappingInternal(IN PVOID Address,
IN ULONG Protection,
IN PPFN_NUMBER Pages,
IN ULONG PageCount,
IN BOOLEAN MarkAsMapped)
{
PMMPTE PointerPte, LastPte, PointerPde, LastPde;
MMPTE TempPte, TempPde;
@ -559,6 +560,11 @@ MmCreateVirtualMappingForKernel(IN PVOID Address,
LastPte = PointerPte + PageCount - 1;
while (PointerPte <= LastPte)
{
//
// Mark it as mapped
//
if (MarkAsMapped) MmMarkPageMapped(*Pages);
//
// Set the PFN
//
@ -596,6 +602,24 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
return 0;
}
NTSTATUS
NTAPI
MmCreateVirtualMappingForKernel(IN PVOID Address,
IN ULONG Protection,
IN PPFN_NUMBER Pages,
IN ULONG PageCount)
{
//
// Call the internal version
//
return MmCreateVirtualMappingInternal(Address,
Protection,
Pages,
PageCount,
FALSE);
}
NTSTATUS
NTAPI
MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
@ -610,12 +634,13 @@ MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
if (!(Process) || (Process == PsGetCurrentProcess()))
{
//
// Call the kernel version
// Call the internal version
//
return MmCreateVirtualMappingForKernel(Address,
Protection,
Pages,
PageCount);
return MmCreateVirtualMappingInternal(Address,
Protection,
Pages,
PageCount,
TRUE);
}
//