- Restart the access fault handler if the return value is STATUS_MM_RESTART_OPERATION.

svn path=/trunk/; revision=4913
This commit is contained in:
Hartmut Birr 2003-06-16 19:20:28 +00:00
parent 11eb72da00
commit 1d64761f02

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: mm.c,v 1.61 2003/05/17 19:16:02 ekohl Exp $ /* $Id: mm.c,v 1.62 2003/06/16 19:20:28 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top directory * COPYRIGHT: See COPYING in the top directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -119,6 +119,7 @@ NTSTATUS MmReleaseMmInfo(PEPROCESS Process)
BOOLEAN STDCALL MmIsNonPagedSystemAddressValid(PVOID VirtualAddress) BOOLEAN STDCALL MmIsNonPagedSystemAddressValid(PVOID VirtualAddress)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
return FALSE;
} }
BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress) BOOLEAN STDCALL MmIsAddressValid(PVOID VirtualAddress)
@ -197,46 +198,50 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode,
{ {
MmLockAddressSpace(AddressSpace); MmLockAddressSpace(AddressSpace);
} }
MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address); do
if (MemoryArea == NULL)
{ {
DbgPrint("%s:%d\n",__FILE__,__LINE__); MemoryArea = MmOpenMemoryAreaByAddress(AddressSpace, (PVOID)Address);
if (!FromMdl) if (MemoryArea == NULL)
{ {
MmUnlockAddressSpace(AddressSpace); if (!FromMdl)
} {
return(STATUS_UNSUCCESSFUL); MmUnlockAddressSpace(AddressSpace);
} }
return (STATUS_UNSUCCESSFUL);
}
switch (MemoryArea->Type) switch (MemoryArea->Type)
{ {
case MEMORY_AREA_SYSTEM: case MEMORY_AREA_SYSTEM:
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
break; break;
case MEMORY_AREA_PAGED_POOL: case MEMORY_AREA_PAGED_POOL:
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
break; break;
case MEMORY_AREA_SECTION_VIEW: case MEMORY_AREA_SECTION_VIEW:
Status = MmAccessFaultSectionView(AddressSpace, Status = MmAccessFaultSectionView(AddressSpace,
MemoryArea, MemoryArea,
(PVOID)Address, (PVOID)Address,
Locked); Locked);
break; break;
case MEMORY_AREA_VIRTUAL_MEMORY: case MEMORY_AREA_VIRTUAL_MEMORY:
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
break; break;
case MEMORY_AREA_SHARED_DATA: case MEMORY_AREA_SHARED_DATA:
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
break; break;
default: default:
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
break; break;
}
} }
while (Status == STATUS_MM_RESTART_OPERATION);
DPRINT("Completed page fault handling\n"); DPRINT("Completed page fault handling\n");
if (!FromMdl) if (!FromMdl)
{ {