Ignore:
Timestamp:
Aug 25, 1999, 12:28:41 PM (26 years ago)
Author:
sandervl
Message:

Put back handlemanager changes + memory mapped file changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/exceptions.cpp

    r634 r678  
    1 /* $Id: exceptions.cpp,v 1.11 1999-08-22 22:11:21 sandervl Exp $ */
     1/* $Id: exceptions.cpp,v 1.12 1999-08-25 10:28:40 sandervl Exp $ */
    22
    33/*
     
    5656#include "exceptions.h"
    5757#include "exceptutil.h"
    58 #include "misc.h"
     58#include <misc.h>
     59#include "mmap.h"
    5960
    6061//Global Process Unhandled exception filter
     
    873874  switch(pERepRec->ExceptionNum)
    874875  {
    875     case XCPT_FLOAT_DENORMAL_OPERAND:
    876     case XCPT_FLOAT_DIVIDE_BY_ZERO:
    877     case XCPT_FLOAT_INEXACT_RESULT:
    878     case XCPT_FLOAT_INVALID_OPERATION:
    879     case XCPT_FLOAT_OVERFLOW:
    880     case XCPT_FLOAT_STACK_CHECK:
    881     case XCPT_FLOAT_UNDERFLOW:
    882       dprintf(("KERNEL32: OS2ExceptionHandler: FPU exception, fix and continue\n"));
    883                pCtxRec->ctx_env[0] |= 0x1F;
    884                pCtxRec->ctx_stack[0].losig = 0;
    885                pCtxRec->ctx_stack[0].hisig = 0;
    886                pCtxRec->ctx_stack[0].signexp = 0;
    887 
    888       return (XCPT_CONTINUE_EXECUTION);
    889 
    890     case XCPT_PROCESS_TERMINATE:
    891     case XCPT_ASYNC_PROCESS_TERMINATE:
    892       SetExceptionChain((ULONG)0);
    893       return (XCPT_CONTINUE_SEARCH);
     876  case XCPT_FLOAT_DENORMAL_OPERAND:
     877  case XCPT_FLOAT_DIVIDE_BY_ZERO:
     878  case XCPT_FLOAT_INEXACT_RESULT:
     879  case XCPT_FLOAT_INVALID_OPERATION:
     880  case XCPT_FLOAT_OVERFLOW:
     881  case XCPT_FLOAT_STACK_CHECK:
     882  case XCPT_FLOAT_UNDERFLOW:
     883        dprintf(("KERNEL32: OS2ExceptionHandler: FPU exception, fix and continue\n"));
     884        pCtxRec->ctx_env[0] |= 0x1F;
     885        pCtxRec->ctx_stack[0].losig = 0;
     886        pCtxRec->ctx_stack[0].hisig = 0;
     887        pCtxRec->ctx_stack[0].signexp = 0;
     888
     889        return (XCPT_CONTINUE_EXECUTION);
     890
     891  case XCPT_PROCESS_TERMINATE:
     892  case XCPT_ASYNC_PROCESS_TERMINATE:
     893        SetExceptionChain((ULONG)0);
     894        return (XCPT_CONTINUE_SEARCH);
    894895
    895896  case XCPT_ACCESS_VIOLATION:
     897  {     
     898   Win32MemMap *map;
     899 
     900        if(pERepRec->ExceptionInfo[1] == 0 && pERepRec->ExceptionInfo[1] == XCPT_DATA_UNKNOWN) {
     901                goto continueFail;
     902        }
     903        map = Win32MemMap::findMap(pERepRec->ExceptionInfo[0]);
     904        if(map == NULL) {
     905                goto continueFail;
     906        }
     907        switch(pERepRec->ExceptionInfo[0]) {
     908        case XCPT_READ_ACCESS:
     909                if(map->hasReadAccess() == FALSE) {
     910                        goto continueFail;
     911                }
     912                break;
     913        case XCPT_WRITE_ACCESS:
     914                if(map->hasWriteAccess() == FALSE) {
     915                        goto continueFail;
     916                }
     917                break;
     918        case XCPT_EXECUTE_ACCESS:
     919                if(map->hasExecuteAccess() == FALSE) {
     920                        goto continueFail;
     921                }
     922                break;
     923        default:
     924                goto continueFail;
     925        }
     926        //Might want to consider mapping more than one page if access is at
     927        //a high offset in the page
     928        if(map->commitPage((LPVOID)pERepRec->ExceptionInfo[1], 1) == TRUE)
     929                return (XCPT_CONTINUE_EXECUTION);
     930
     931        //no break;
     932  }
     933continueFail:
     934
    896935  case XCPT_BREAKPOINT:
    897936  case XCPT_ARRAY_BOUNDS_EXCEEDED:
     
    907946  case XCPT_IN_PAGE_ERROR:
    908947  case XCPT_SIGNAL:
    909     dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill\n"));
    910     pCtxRec->ctx_RegEip = (ULONG)KillWin32Process;
    911     pCtxRec->ctx_RegEsp = pCtxRec->ctx_RegEsp + 0x10;
    912     pCtxRec->ctx_RegEax = pERepRec->ExceptionNum;
    913     pCtxRec->ctx_RegEbx = pCtxRec->ctx_RegEip;
    914     return (XCPT_CONTINUE_EXECUTION);
     948        dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill\n"));
     949        pCtxRec->ctx_RegEip = (ULONG)KillWin32Process;
     950        pCtxRec->ctx_RegEsp = pCtxRec->ctx_RegEsp + 0x10;
     951        pCtxRec->ctx_RegEax = pERepRec->ExceptionNum;
     952        pCtxRec->ctx_RegEbx = pCtxRec->ctx_RegEip;
     953        return (XCPT_CONTINUE_EXECUTION);
    915954
    916955  default: //non-continuable exceptions
Note: See TracChangeset for help on using the changeset viewer.