Ignore:
Timestamp:
Jul 26, 2002, 12:47:33 PM (23 years ago)
Author:
sandervl
Message:

kill thread when it crashes after ExitProcess

File:
1 edited

Legend:

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

    r8840 r8920  
    1 /* $Id: exceptions.cpp,v 1.64 2002-07-05 17:59:30 sandervl Exp $ */
     1/* $Id: exceptions.cpp,v 1.65 2002-07-26 10:47:33 sandervl Exp $ */
    22
    33/*
     
    679679    SetExceptionChain((ULONG)-1);
    680680    DosExit(EXIT_PROCESS, 666);
     681}
     682//*****************************************************************************
     683//*****************************************************************************
     684void KillWin32Thread(void)
     685{
     686//    ExitThread(666);
     687    //Restore original OS/2 TIB selector
     688    RestoreOS2FS();
     689
     690    SetExceptionChain((ULONG)-1);
     691    DosExit(EXIT_THREAD, 666);
    681692}
    682693//*****************************************************************************
     
    12831294#ifdef DEBUG
    12841295        dprintfException(pERepRec, pERegRec, pCtxRec, p);
    1285         if(pCtxRec->ContextFlags & CONTEXT_CONTROL) {
     1296        if(!fExitProcess && (pCtxRec->ContextFlags & CONTEXT_CONTROL)) {
    12861297                dbgPrintStack(pERepRec, pERegRec, pCtxRec, p);
    12871298        }
     
    12901301        if(!fIsOS2Image && !fExitProcess)  //Only for real win32 apps
    12911302        {
    1292                 if(OSLibDispatchException(pERepRec, pERegRec, pCtxRec, p) == TRUE)
     1303            if(OSLibDispatchException(pERepRec, pERegRec, pCtxRec, p) == TRUE)
     1304            {
     1305                goto continueexecution;
     1306            }
     1307        }
     1308        else {
     1309            if(fExitProcess) {
     1310                PPIB   pPIB;
     1311                PTIB   pTIB;
     1312                APIRET rc;
     1313
     1314                rc = DosGetInfoBlocks (&pTIB, &pPIB);
     1315                if(rc == NO_ERROR && pTIB->tib_ptib2->tib2_ultid != 1)
    12931316                {
    1294                         goto continueexecution;
     1317                    dprintf(("KERNEL32: OS2ExceptionHandler: Continue and kill thread"));
     1318
     1319                    pCtxRec->ctx_RegEip = (ULONG)KillWin32Thread;
     1320                    pCtxRec->ctx_RegEsp = pCtxRec->ctx_RegEsp + 0x10;
     1321                    pCtxRec->ctx_RegEax = pERepRec->ExceptionNum;
     1322                    pCtxRec->ctx_RegEbx = pCtxRec->ctx_RegEip;
     1323                    goto continueexecution;
    12951324                }
    1296         }
    1297         else    goto continuesearch; //pass on to OS/2 RTL or app exception handler
     1325            }
     1326            goto continuesearch; //pass on to OS/2 RTL or app exception handler
     1327        }
    12981328
    12991329        //Log fatal exception here
Note: See TracChangeset for help on using the changeset viewer.