Changeset 1341 for trunk/killproc.c


Ignore:
Timestamp:
Dec 14, 2008, 11:18:26 PM (17 years ago)
Author:
Steven Levine
Message:

Ticket 26: add thread 1 exception handler support to applets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/killproc.c

    r1215 r1341  
    1010
    1111  05 Jan 08 SHL Sync
     12  14 Dec 08 SHL Add exception handler support
    1213
    1314***********************************************************************/
     
    1516#define INCL_DOS
    1617#define INCL_WIN
     18#define INCL_DOSEXCEPTIONS              // XCTP_...
     19#define INCL_DOSERRORS                  // NO_ERROR
    1720
    1821#include "dll\fm3dll.h"
    19 #include "dll\mainwnd.h"                        // Data declaration(s)
     22#include "dll\mainwnd.h"                // FM3ModHandle
    2023#include "dll\fm3dlg.h"
    21 #include "dll\init.h"                           // InitFM3DLL
    22 #include "dll\killproc.h"                       // KillDlgProc
     24#include "dll\init.h"                   // InitFM3DLL
     25#include "dll\killproc.h"               // KillDlgProc
     26#include "dll\errutil.h"                // Error reporting
     27#include "dll\excputil.h"               // Exception handlers
     28
     29static PSZ pszSrcFile = __FILE__;
    2330
    2431int main(int argc, char *argv[])
     
    2633  HAB hab;
    2734  HMQ hmq;
     35  APIRET regRet;
     36  EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
    2837
    2938  DosError(FERR_DISABLEHARDERR);
     39
     40  regRec.ExceptionHandler = HandleException;
     41  regRet = DosSetExceptionHandler(&regRec);
     42  if (regRet != NO_ERROR) {
     43    DbgMsg(pszSrcFile, __LINE__,
     44           "DosSetExceptionHandler failed with error %u", regRet);
     45  }
     46
    3047  hab = WinInitialize(0);
    3148  if (hab) {
     
    3350    if (hmq) {
    3451      if (InitFM3DLL(hab, argc, argv)) {
    35         WinDlgBox(HWND_DESKTOP,
    36                   HWND_DESKTOP, KillDlgProc, FM3ModHandle, KILL_FRAME, NULL);
     52        WinDlgBox(HWND_DESKTOP,
     53                  HWND_DESKTOP, KillDlgProc, FM3ModHandle, KILL_FRAME, NULL);
    3754      }
    3855      DosSleep(250L);
Note: See TracChangeset for help on using the changeset viewer.