mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:46:17 +00:00
- 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:
parent
6c50287599
commit
4cdbf59086
1 changed files with 34 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue