Ignore:
Timestamp:
Aug 5, 1999, 3:14:18 PM (26 years ago)
Author:
phaller
Message:

Add: interactive user control for exception handling dialog (abort, retry, ignore)

File:
1 edited

Legend:

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

    r413 r420  
    1 /* $Id: exceptions.cpp,v 1.8 1999-08-04 14:39:06 phaller Exp $ */
     1/* $Id: exceptions.cpp,v 1.9 1999-08-05 13:11:38 phaller Exp $ */
    22
    33/*
     
    4747#define INCL_MISC
    4848#define INCL_BASE
     49#define INCL_WINBUTTONS
    4950#include <os2wrap.h>                     //Odin32 OS/2 api wrappers
    5051#include <stdio.h>
     
    6667
    6768LONG WIN32API UnhandledExceptionFilter(PWINEXCEPTION_POINTERS lpexpExceptionInfo);
     69void KillWin32Process(void);
    6870
    6971
     
    313315  DWORD rc;
    314316
     317  // @@@PH: experimental change to have more control over exception handling
     318#pragma pack(4)
     319  typedef struct
     320   {
     321      ULONG    cb;                  /* Size of fixed part of structure          */
     322      HPOINTER hIcon;               /* Icon handle                              */
     323      ULONG    cButtons;            /* Number of buttons                        */
     324      ULONG    flStyle;             /* Icon style flags (MB_ICONQUESTION, etc...)*/
     325      HWND     hwndNotify;          /* Reserved                                 */
     326      MB2D     mb2d[4];             /* Array of button definitions              */
     327   } myMB2INFO;
     328#pragma pack()
     329
     330  myMB2INFO mb2InfoExceptionBox = { 20,             // size of structure
     331                                    NULLHANDLE,     // icon handle
     332                                    4,              // number of buttons
     333                                    MB_ICONHAND,    // icon style
     334                                    NULLHANDLE,     // reserved
     335                                    { {"continue ~search",    100, BS_PUSHBUTTON | BS_TEXT | BS_AUTOSIZE},
     336                                      {"continue ~execution", 101, BS_PUSHBUTTON | BS_TEXT | BS_AUTOSIZE},
     337                                      {"execute ~handler",    102, BS_PUSHBUTTON | BS_TEXT | BS_AUTOSIZE | BS_DEFAULT},
     338                                      {"~terminate process",  103, BS_PUSHBUTTON | BS_TEXT | BS_AUTOSIZE} }
     339                                  };
     340
    315341  dprintf(("KERNEL32: UnhandledExceptionFilter\n"));
    316342
     
    326352          lpexpExceptionInfo->ExceptionRecord->ExceptionCode,
    327353          lpexpExceptionInfo->ExceptionRecord->ExceptionAddress);
    328 
    329   WinMessageBox(HWND_DESKTOP,
    330                 HWND_DESKTOP,
    331                 message,
    332                 "Oh, nooo!",
    333                 0,
    334                 MB_OK);
    335 
    336   return WINEXCEPTION_EXECUTE_HANDLER;
     354/*
     355  rc = WinMessageBox2(HWND_DESKTOP,
     356                     HWND_DESKTOP,
     357                     message,
     358                     "Oh, nooo!",
     359                     0,
     360                     (PMB2INFO)&mb2InfoExceptionBox);
     361   switch (rc)
     362   {
     363     case 100:
     364       return WINEXCEPTION_CONTINUE_SEARCH;
     365
     366     case 101:
     367       return WINEXCEPTION_CONTINUE_EXECUTION;
     368
     369     case 102:
     370       return WINEXCEPTION_EXECUTE_HANDLER;
     371
     372     case 103:
     373       KillWin32Process();
     374       // fall-through
     375
     376     default:
     377       return WINEXCEPTION_EXECUTE_HANDLER;
     378   }
     379*/
     380  rc = WinMessageBox(HWND_DESKTOP,
     381                     HWND_DESKTOP,
     382                     message,
     383                     "Oh, nooo!",
     384                     0,
     385                     MB_ABORTRETRYIGNORE | MB_ERROR);
     386   switch (rc)
     387   {
     388     case MBID_IGNORE:
     389       return WINEXCEPTION_CONTINUE_EXECUTION;
     390
     391     case MBID_ABORT:
     392       KillWin32Process();
     393       // fall-through
     394
     395     case MBID_RETRY:
     396     default:
     397       return WINEXCEPTION_EXECUTE_HANDLER;
     398   }
    337399}
    338400
Note: See TracChangeset for help on using the changeset viewer.