Ignore:
Timestamp:
Nov 9, 1999, 8:22:33 PM (26 years ago)
Author:
sandervl
Message:

thread fixes + heap wrappers

File:
1 edited

Legend:

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

    r1663 r1670  
    1 /* $Id: windllbase.cpp,v 1.3 1999-11-09 14:19:47 sandervl Exp $ */
     1/* $Id: windllbase.cpp,v 1.4 1999-11-09 19:22:32 sandervl Exp $ */
    22
    33/*
     
    102102 WINEXCEPTION_FRAME exceptFrame;
    103103 USHORT sel;
    104  BOOL rc;
     104 THDB *thdb;
     105 BOOL rc, fSetExceptionHandler;
    105106
    106107  if(fAttachedToProcess)
     
    108109
    109110  fAttachedToProcess = TRUE;
     111
     112  thdb = GetThreadTHDB();
     113  fSetExceptionHandler = (!thdb || thdb->teb_sel != GetFS());
     114
     115  //Note: The Win32 exception structure references by FS:[0] is the same
     116  //      in OS/2
     117  if(fSetExceptionHandler) {
     118        OS2SetExceptionHandler((void *)&exceptFrame);
     119        sel = SetWin32TIB();
     120  }
    110121
    111122  //Allocate TLS index for this module
     
    115126  if(fSkipEntryCalls || dllEntryPoint == NULL) {
    116127        dprintf(("attachProcess not required for dll %s", szModule));
     128        if(fSetExceptionHandler) {
     129                SetFS(sel);
     130                OS2UnsetExceptionHandler((void *)&exceptFrame);
     131        }
    117132        return(TRUE);
    118133  }
     
    120135  dprintf(("attachProcess to dll %s", szModule));
    121136
    122   //Note: The Win32 exception structure references by FS:[0] is the same
    123   //      in OS/2
    124   OS2SetExceptionHandler((void *)&exceptFrame);
    125 
    126   sel = SetWin32TIB();
    127137  rc = dllEntryPoint(hinstance, DLL_PROCESS_ATTACH, 0);
    128   SetFS(sel);
    129 
    130   OS2UnsetExceptionHandler((void *)&exceptFrame);
    131 
     138
     139  dprintf(("attachProcess to dll %s DONE", szModule));
     140
     141  if(fSetExceptionHandler) {
     142        SetFS(sel);
     143        OS2UnsetExceptionHandler((void *)&exceptFrame);
     144  }
    132145  return rc;
    133146}
     
    174187
    175188  dprintf(("attachThread to dll %s", szModule));
    176   //Note: The Win32 exception structure references by FS:[0] is the same
    177   //      in OS/2
    178   OS2SetExceptionHandler((void *)&exceptFrame);
    179189
    180190  rc = dllEntryPoint(hinstance, DLL_THREAD_ATTACH, 0);
    181191
    182   OS2UnsetExceptionHandler((void *)&exceptFrame);
     192  dprintf(("attachThread to dll %s DONE", szModule));
     193
    183194  return rc;
    184195}
     
    195206  dprintf(("attachThread from dll %s", szModule));
    196207
    197   //Note: The Win32 exception structure references by FS:[0] is the same
    198   //      in OS/2
    199   OS2SetExceptionHandler((void *)&exceptFrame);
    200 
    201208  rc =  dllEntryPoint(hinstance, DLL_THREAD_DETACH, 0);
    202 
    203   OS2UnsetExceptionHandler((void *)&exceptFrame);
    204209  return rc;
    205210}
Note: See TracChangeset for help on using the changeset viewer.