Ignore:
Timestamp:
Aug 22, 1999, 1:11:11 PM (26 years ago)
Author:
sandervl
Message:

Exception handler changes

File:
1 edited

Legend:

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

    r420 r617  
    1 /* $Id: exceptions.cpp,v 1.9 1999-08-05 13:11:38 phaller Exp $ */
     1/* $Id: exceptions.cpp,v 1.10 1999-08-22 11:11:10 sandervl Exp $ */
    22
    33/*
     
    5555#include <builtin.h>
    5656#include "exceptions.h"
    57 #include "except.h"
     57#include "exceptutil.h"
    5858#include "misc.h"
    5959
     
    450450  excptaddr = getEBX();
    451451
    452   dprintf(("KERNEL32: KillWin32Process: Do you feel lucky, punk?!\n"));
    453 //  sprintf(excptmsg, "Fatal Exception %X at %X", excptnr, excptaddr);
    454 //  WinMessageBox(HWND_DESKTOP, NULL, excptmsg, "Win32 for OS/2", 0, MB_ERROR | MB_OK);
     452  dprintf(("KERNEL32: KillWin32Process: Do you feel lucky, punk? (FS=%d)!\n", GetFS()));
     453  //Restore original OS/2 TIB selector
     454  RestoreOS2FS();
     455
    455456  SetExceptionChain((ULONG)0);
    456457  DosExit(EXIT_PROCESS, 666);
     
    861862#endif
    862863
    863 ERR _System OS2ExceptionHandler(PEXCEPTIONREPORTRECORD       pERepRec,
    864                                 PEXCEPTIONREGISTRATIONRECORD pERegRec,
    865                                 PCONTEXTRECORD               pCtxRec,
    866                                 PVOID                        p)
     864ULONG APIENTRY OS2ExceptionHandler(PEXCEPTIONREPORTRECORD       pERepRec,
     865                                   PEXCEPTIONREGISTRATIONRECORD pERegRec,
     866                                   PCONTEXTRECORD               pCtxRec,
     867                                   PVOID                        p)
    867868{
    868869  //  pERegRec->prev_structure = 0;
     
    885886               pCtxRec->ctx_stack[0].signexp = 0;
    886887
    887       return (ERR)(XCPT_CONTINUE_EXECUTION);
     888      return (XCPT_CONTINUE_EXECUTION);
    888889
    889890    case XCPT_PROCESS_TERMINATE:
     
    911912    pCtxRec->ctx_RegEax = pERepRec->ExceptionNum;
    912913    pCtxRec->ctx_RegEbx = pCtxRec->ctx_RegEip;
    913     return (ERR)(XCPT_CONTINUE_EXECUTION);
     914    return (XCPT_CONTINUE_EXECUTION);
    914915
    915916  default: //non-continuable exceptions
     
    919920}
    920921
     922/*****************************************************************************
     923 * Name      : void OS2SetExceptionHandler
     924 * Purpose   : Sets the main thread exception handler in FS:[0] (original OS/2 FS selector)
     925 * Parameters: exceptframe: pointer to exception handler frame on stack (2 ULONGs)
     926 * Variables :
     927 * Result    :
     928 * Remark    :
     929 * Status    :
     930 *
     931 * Author    : Sander van Leeuwen [Sun, 1999/08/21 12:16]
     932 *****************************************************************************/
     933void OS2SetExceptionHandler(void *exceptframe)
     934{
     935 PEXCEPTIONREGISTRATIONRECORD pExceptRec = (PEXCEPTIONREGISTRATIONRECORD)exceptframe;
     936
     937  pExceptRec->prev_structure   = 0;
     938  pExceptRec->ExceptionHandler = OS2ExceptionHandler;
     939
     940  /* disable trap popups */
     941//  DosError(FERR_DISABLEEXCEPTION | FERR_DISABLEHARDERR);
     942
     943  DosSetExceptionHandler(pExceptRec);
     944}
     945
     946/*****************************************************************************
     947 * Name      : void OS2UnsetExceptionHandler
     948 * Purpose   : Removes the main thread exception handler in FS:[0] (original OS/2 FS selector)
     949 * Parameters: exceptframe: pointer to exception handler frame on stack (2 ULONGs)
     950 * Variables :
     951 * Result    :
     952 * Remark    :
     953 * Status    :
     954 *
     955 * Author    : Sander van Leeuwen [Sun, 1999/08/21 12:16]
     956 *****************************************************************************/
     957void OS2UnsetExceptionHandler(void *exceptframe)
     958{
     959  DosUnsetExceptionHandler((PEXCEPTIONREGISTRATIONRECORD)exceptframe);
     960}
    921961
    922962/*****************************************************************************
Note: See TracChangeset for help on using the changeset viewer.