Updated memory area const names.

svn path=/trunk/; revision=3334
This commit is contained in:
Eugene Ingerman 2002-08-16 22:03:07 +00:00
parent 99c4e70f22
commit 1052bedeed
2 changed files with 14 additions and 15 deletions

View file

@ -1968,8 +1968,7 @@ COMMAND_PROTOTYPE(ShowVirtualMemory)
MEMORY_AREA, MEMORY_AREA,
Entry); Entry);
// find the filename // find the filename
if(((current->Type == MEMORY_AREA_SECTION_VIEW_COMMIT) || if(((current->Type == MEMORY_AREA_SECTION_VIEW) ) &&
(current->Type == MEMORY_AREA_SECTION_VIEW_RESERVE) )&&
current->Data.SectionData.Section->FileObject) current->Data.SectionData.Section->FileObject)
{ {
if(IsAddressValid((ULONG)current->Data.SectionData.Section->FileObject->FileName.Buffer) ) if(IsAddressValid((ULONG)current->Data.SectionData.Section->FileObject->FileName.Buffer) )

View file

@ -63,14 +63,14 @@ ULONG HandleInDebuggerFault(FRAME* ptr,ULONG address)
ENTER_FUNC(); ENTER_FUNC();
DPRINT((2,"HandleInDebuggerFault(): ###### page fault @ %.8X while inside debugger, eip: %x\n",address, ptr->eip)); DPRINT((0,"HandleInDebuggerFault(): ###### page fault @ %.8X while inside debugger, eip: %x\n",address, ptr->eip));
// fault in this page fault handler // fault in this page fault handler
if(bInPageFaultHandler) if(bInPageFaultHandler)
{ {
DPRINT((2,"HandleInDebuggerFault(): ###### page fault @ %.8X while in page fault handler\n",address)); DPRINT((0,"HandleInDebuggerFault(): ###### page fault @ %.8X while in page fault handler\n",address));
DPRINT((2,"!!! machine is halted !!!\n")); DPRINT((0,"!!! machine is halted !!!\n"));
__asm__ __volatile__ ("hlt"); __asm__ __volatile__ ("hlt");
LEAVE_FUNC(); LEAVE_FUNC();
@ -83,7 +83,7 @@ ULONG HandleInDebuggerFault(FRAME* ptr,ULONG address)
// so the current task is different as well // so the current task is different as well
tsk = IoGetCurrentProcess(); tsk = IoGetCurrentProcess();
DPRINT((2,"%.8X (%.4X:%.8X %.8X %s %s %s task=%.8X )\n", DPRINT((0,"%.8X (%.4X:%.8X %.8X %s %s %s task=%.8X )\n",
address, address,
ptr->cs, ptr->cs,
ptr->eip, ptr->eip,
@ -163,7 +163,7 @@ ULONG HandlePageFault(FRAME* ptr)
// there's something terribly wrong if we get a fault in our command handler // there's something terribly wrong if we get a fault in our command handler
if(bInDebuggerShell) if(bInDebuggerShell)
{ {
DPRINT((2,"return handleindebuggerfault\n")); DPRINT((0,"return handleindebuggerfault\n"));
return HandleInDebuggerFault(ptr,(ULONG)address); return HandleInDebuggerFault(ptr,(ULONG)address);
} }
@ -181,8 +181,9 @@ ULONG HandlePageFault(FRAME* ptr)
*/ */
// current process // current process
tsk = IoGetCurrentProcess(); tsk = IoGetCurrentProcess();
DPRINT((0,"tsk: %x\t", tsk));
if( !tsk || !(IsAddressValid((ULONG)tsk))){ if( !tsk || !(IsAddressValid((ULONG)tsk))){
DPRINT((2,"tsk address not valid: tsk: %x\n", tsk)); DPRINT((0,"tsk address not valid: tsk: %x\n", tsk));
return 0; return 0;
} }
@ -207,25 +208,24 @@ ULONG HandlePageFault(FRAME* ptr)
MEMORY_AREA, MEMORY_AREA,
Entry); Entry);
DPRINT((0,"address: %x %x - %x Attrib: %x, Type: %x\n", address, current->BaseAddress, current->BaseAddress + current->Length, current->Attributes, current->Type));
if( (address >= current->BaseAddress) && (address <= current->BaseAddress + current->Length )) if( (address >= current->BaseAddress) && (address <= current->BaseAddress + current->Length ))
{ {
DPRINT((0,"address: %x %x - %x Attrib: %x, Type: %x\n", address, current->BaseAddress, current->BaseAddress + current->Length, current->Attributes, current->Type));
//page not present //page not present
if( !(error_code & 1) ){ if( !(error_code & 1) ){
//check it is in pageable area //check it is in pageable area
if( current->Type == MEMORY_AREA_SECTION_VIEW_COMMIT || if( current->Type == MEMORY_AREA_SECTION_VIEW ||
current->Type == MEMORY_AREA_SECTION_VIEW_RESERVE ||
current->Type == MEMORY_AREA_VIRTUAL_MEMORY || current->Type == MEMORY_AREA_VIRTUAL_MEMORY ||
current->Type == MEMORY_AREA_PAGED_POOL || current->Type == MEMORY_AREA_PAGED_POOL ||
current->Type == MEMORY_AREA_SHARED_DATA current->Type == MEMORY_AREA_SHARED_DATA
){ ){
//ei too much output Print(OUTPUT_WINDOW,"pICE: VMA Pageable Section.\n"); //ei too much output Print(OUTPUT_WINDOW,"pICE: VMA Pageable Section.\n");
//ei DPRINT((2,"return 0 1\n")); //ei DPRINT((0,"return 0 1\n"));
return 0; //let the system handle this return 0; //let the system handle this
} }
Print(OUTPUT_WINDOW,"pICE: VMA Page not present in non-pageable Section!\n"); Print(OUTPUT_WINDOW,"pICE: VMA Page not present in non-pageable Section!\n");
//ei DPRINT((2,"Type: currenttype: %x return 1 2\n", current->Type)); //ei DPRINT((0,"Type: currenttype: %x return 1 2\n", current->Type));
return 0; return 0;
} }
else{ //access violation else{ //access violation
@ -235,10 +235,10 @@ ULONG HandlePageFault(FRAME* ptr)
if( (ULONG)address >= KERNEL_BASE ) if( (ULONG)address >= KERNEL_BASE )
{ {
Print(OUTPUT_WINDOW,"pICE: User mode program trying to access kernel memory!\n"); Print(OUTPUT_WINDOW,"pICE: User mode program trying to access kernel memory!\n");
//DPRINT((2,"return 0 3\n")); //DPRINT((0,"return 0 3\n"));
return 1; return 1;
} }
//DPRINT((2,"return 0 4\n")); //DPRINT((0,"return 0 4\n"));
return 0; return 0;
} }
/* /*