Paste: fix

Author: slava
Mode: factor
Date: Tue, 18 Nov 2008 03:09:11
Plain Text |
long exception_handler(PEXCEPTION_POINTERS pe)
{
       PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)pe->ExceptionRecord;
       CONTEXT *c = (CONTEXT*)pe->ContextRecord;

       if(in_code_heap_p(c->EIP))
               signal_callstack_top = (void *)c->ESP;
       else
               signal_callstack_top = NULL;

       if(e->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
       {
               signal_fault_addr = e->ExceptionInformation[1];
               c->EIP = (CELL)memory_signal_handler_impl;
       }
       else if(e->ExceptionCode == EXCEPTION_FLT_DIVIDE_BY_ZERO
                       || e->ExceptionCode == EXCEPTION_INT_DIVIDE_BY_ZERO)
       {
               signal_number = ERROR_DIVIDE_BY_ZERO;
               c->EIP = (CELL)divide_by_zero_signal_handler_impl;
       }
       else if(e->ExceptionCode != 0x40010006)
       {
               signal_number = 11;
               c->EIP = (CELL)misc_signal_handler_impl;
       }

       return EXCEPTION_CONTINUE_EXECUTION;
}

New Annotation

Summary:
Author:
Mode:
Body: