Ignore:
Timestamp:
Nov 21, 2000, 12:36:09 PM (25 years ago)
Author:
sandervl
Message:

Updates for TEB changes

File:
1 edited

Legend:

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

    r4496 r4658  
    1 /* $Id: misc.cpp,v 1.27 2000-10-18 17:09:33 sandervl Exp $ */
     1/* $Id: misc.cpp,v 1.28 2000-11-21 11:35:08 sandervl Exp $ */
    22
    33/*
     
    289289  if(fLogging && flog && (dwEnableLogging > 0))
    290290  {
    291     THDB *thdb = GetThreadTHDB();
     291    TEB *teb = GetThreadTEB();
    292292
    293293    va_start(argptr, tekst);
    294     if(thdb) {
    295     thdb->logfile = (DWORD)flog;
     294    if(teb) {
     295        teb->o.odin.logfile = (DWORD)flog;
    296296        if(sel == 0x150b && !fIsOS2Image) {
    297         fprintf(flog, "t%d: (FS=150B) ", thdb->threadId);
    298     }
    299     else    fprintf(flog, "t%d: ", thdb->threadId);
     297        fprintf(flog, "t%d: (FS=150B) ", teb->o.odin.threadId);
     298    }
     299    else    fprintf(flog, "t%d: ", teb->o.odin.threadId);
    300300    }
    301301    vfprintf(flog, tekst, argptr);
    302     if(thdb) thdb->logfile = 0;
     302    if(teb) teb->o.odin.logfile = 0;
    303303    va_end(argptr);
    304304
     
    342342  if(fLogging && flog && (dwEnableLogging > 0))
    343343  {
    344     THDB *thdb = GetThreadTHDB();
     344    TEB *teb = GetThreadTEB();
    345345
    346346    va_start(argptr, tekst);
    347     if(thdb) {
    348         thdb->logfile = (DWORD)flog;
     347    if(teb) {
     348        teb->o.odin.logfile = (DWORD)flog;
    349349    }
    350350    vfprintf(flog, tekst, argptr);
    351     if(thdb) thdb->logfile = 0;
     351    if(teb) teb->o.odin.logfile = 0;
    352352    va_end(argptr);
    353353  }
     
    376376  if(fLogging && logfile)
    377377  {
    378     THDB *thdb = GetThreadTHDB();
     378    TEB *teb = GetThreadTEB();
    379379
    380380    va_start(argptr, tekst);
    381     if(thdb) {
    382         thdb->logfile = (DWORD)flog;
     381    if(teb) {
     382        teb->o.odin.logfile = (DWORD)flog;
    383383    }
    384384    vfprintf((FILE *)logfile, tekst, argptr);
    385     if(thdb) thdb->logfile = 0;
     385    if(teb) teb->o.odin.logfile = 0;
    386386    va_end(argptr);
    387387
     
    400400void LogException(int state)
    401401{
    402   THDB *thdb = GetThreadTHDB();
     402  TEB *teb = GetThreadTEB();
    403403  USHORT *lock;
    404404
    405   if(!thdb) return;
    406 
    407   if(thdb->logfile) {
     405  if(!teb) return;
     406
     407  if(teb->o.odin.logfile) {
    408408    if(state == ENTER_EXCEPTION) {
    409409#if (__IBMCPP__ == 300) || (__IBMC__ == 300)
    410         lock = (USHORT *)(thdb->logfile+0x1C);
     410        lock = (USHORT *)(teb->o.odin.logfile+0x1C);
    411411#else
    412412#error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
     
    416416    else { //LEAVE_EXCEPTION
    417417#if (__IBMCPP__ == 300) || (__IBMC__ == 300)
    418         lock = (USHORT *)(thdb->logfile+0x1C);
     418        lock = (USHORT *)(teb->o.odin.logfile+0x1C);
    419419#else
    420420#error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
     
    431431void CheckLogException()
    432432{
    433   THDB *thdb = GetThreadTHDB();
     433  TEB *teb = GetThreadTEB();
    434434  USHORT *lock;
    435435
    436   if(!thdb) return;
    437 
    438   if(thdb->logfile) {
     436  if(!teb) return;
     437
     438  if(teb->o.odin.logfile) {
    439439    //oops, exception in vfprintf; let's clear the lock count
    440440#if (__IBMCPP__ == 300) || (__IBMC__ == 300)
    441     lock = (USHORT *)(thdb->logfile+0x1C);
     441    lock = (USHORT *)(teb->o.odin.logfile+0x1C);
    442442#else
    443443#error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
Note: See TracChangeset for help on using the changeset viewer.