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/windll.cpp

    r550 r617  
    1 /* $Id: windll.cpp,v 1.10 1999-08-18 17:18:00 sandervl Exp $ */
     1/* $Id: windll.cpp,v 1.11 1999-08-22 11:11:11 sandervl Exp $ */
    22
    33/*
     
    2828#include <windll.h>
    2929#include <wprocess.h>
     30#include "exceptions.h"
     31#include "exceptutil.h"
    3032#include "cio.h"
    3133
     
    268270BOOL Win32Dll::attachProcess()
    269271{
     272 WINEXCEPTION_FRAME exceptFrame;
     273 USHORT sel;
    270274 BOOL rc;
    271  USHORT sel;
    272275
    273276  //Allocate TLS index for this module
     
    282285  dprintf(("attachProcess to dll %s", szModule));
    283286
     287  //Note: The Win32 exception structure references by FS:[0] is the same
     288  //      in OS/2
     289  OS2SetExceptionHandler((void *)&exceptFrame);
     290
    284291  sel = SetWin32TIB();
    285292  rc = dllEntryPoint(hinstance, DLL_PROCESS_ATTACH, 0);
    286293  SetFS(sel);
     294
     295  OS2UnsetExceptionHandler((void *)&exceptFrame);
     296
    287297  return rc;
    288298}
     
    291301BOOL Win32Dll::detachProcess()
    292302{
    293  BOOL   rc;
     303 WINEXCEPTION_FRAME exceptFrame;
    294304 USHORT sel;
     305 BOOL rc;
    295306
    296307  if(fSystemDll || fSkipEntryCalls) {
     
    300311
    301312  dprintf(("detachProcess from dll %s", szModule));
     313
     314  //Note: The Win32 exception structure references by FS:[0] is the same
     315  //      in OS/2
     316  OS2SetExceptionHandler((void *)&exceptFrame);
    302317
    303318  fUnloaded = TRUE;
     
    307322  tlsDetachThread();    //destroy TLS (main thread)
    308323  tlsDelete();
     324
     325  OS2UnsetExceptionHandler((void *)&exceptFrame);
     326
    309327  return rc;
    310328}
     
    313331BOOL Win32Dll::attachThread()
    314332{
     333 WINEXCEPTION_FRAME exceptFrame;
     334 BOOL               rc;
     335
    315336  if(fSystemDll || fSkipEntryCalls)
    316337        return(TRUE);
    317338
    318339  dprintf(("attachThread to dll %s", szModule));
    319   return dllEntryPoint(hinstance, DLL_THREAD_ATTACH, 0);
     340  //Note: The Win32 exception structure references by FS:[0] is the same
     341  //      in OS/2
     342  OS2SetExceptionHandler((void *)&exceptFrame);
     343
     344  rc = dllEntryPoint(hinstance, DLL_THREAD_ATTACH, 0);
     345
     346  OS2UnsetExceptionHandler((void *)&exceptFrame);
     347  return rc;
    320348}
    321349//******************************************************************************
     
    323351BOOL Win32Dll::detachThread()
    324352{
     353 WINEXCEPTION_FRAME exceptFrame;
     354 BOOL               rc;
     355
    325356  if(fSystemDll || fSkipEntryCalls)
    326357        return(TRUE);
    327358
    328359  dprintf(("attachThread from dll %s", szModule));
    329   return dllEntryPoint(hinstance, DLL_THREAD_DETACH, 0);
     360
     361  //Note: The Win32 exception structure references by FS:[0] is the same
     362  //      in OS/2
     363  OS2SetExceptionHandler((void *)&exceptFrame);
     364
     365  rc =  dllEntryPoint(hinstance, DLL_THREAD_DETACH, 0);
     366
     367  OS2UnsetExceptionHandler((void *)&exceptFrame);
     368  return rc;
    330369}
    331370//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.