Changeset 21979 for trunk/src/kernel32/dbglog.cpp
- Timestamp:
- Mar 9, 2012, 10:26:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/dbglog.cpp
r21959 r21979 317 317 } 318 318 319 static ULONG _System WriteLogExcHandler(PEXCEPTIONREPORTRECORD pReport, 320 PEXCEPTIONREGISTRATIONRECORD pRegRec, 321 PCONTEXTRECORD pContext, 322 PVOID pv) 323 { 324 switch (pReport->ExceptionNum) 325 { 326 case XCPT_PROCESS_TERMINATE: 327 case XCPT_ASYNC_PROCESS_TERMINATE: 328 case XCPT_UNWIND: 329 // disable further (possibly, recursive) handler calls 330 DosUnsetExceptionHandler(pRegRec); 331 // free the mutex to avoid deadlocks and make sure other threads can print 332 logMutex.leave(); 333 break; 334 } 335 336 return XCPT_CONTINUE_SEARCH; 337 } 338 319 339 int SYSTEM WriteLog(const char *tekst, ...) 320 340 { … … 322 342 va_list argptr; 323 343 TEB *teb = GetThreadTEB(); 344 345 EXCEPTIONREGISTRATIONRECORD RegRec = {0, WriteLogExcHandler}; 346 DosSetExceptionHandler(&RegRec); 324 347 325 348 logMutex.enter(); … … 396 419 if(teb->o.odin.threadId < 5 && fDisableThread[teb->o.odin.threadId-1] == 1) 397 420 { 421 logMutex.leave(); 422 DosUnsetExceptionHandler(&RegRec); 398 423 SetFS(sel); 399 logMutex.leave();400 424 return 1; 401 425 } … … 407 431 fflush(flog); 408 432 433 logMutex.leave(); 434 DosUnsetExceptionHandler(&RegRec); 409 435 SetFS(sel); 410 logMutex.leave();411 436 return 1; 412 437 } … … 621 646 } 622 647 648 logMutex.leave(); 649 DosUnsetExceptionHandler(&RegRec); 623 650 SetFS(sel); 624 logMutex.leave();625 651 return 1; 626 652 } … … 631 657 USHORT sel = RestoreOS2FS(); 632 658 va_list argptr; 659 660 EXCEPTIONREGISTRATIONRECORD RegRec = {0, WriteLogExcHandler}; 661 DosSetExceptionHandler(&RegRec); 633 662 634 663 logMutex.enter(); … … 673 702 } 674 703 704 logMutex.leave(); 705 DosUnsetExceptionHandler(&RegRec); 675 706 SetFS(sel); 676 logMutex.leave();677 707 return 1; 678 708 }
Note:
See TracChangeset
for help on using the changeset viewer.