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

    r3422 r4658  
    1 /* $Id: thread.cpp,v 1.25 2000-04-18 20:06:38 sandervl Exp $ */
     1/* $Id: thread.cpp,v 1.26 2000-11-21 11:35:09 sandervl Exp $ */
    22
    33/*
     
    4848HANDLE WIN32API GetCurrentThread()
    4949{
    50  THDB *thdb;
     50 TEB *teb;
    5151
    52     thdb = GetThreadTHDB();
    53     if(thdb == 0) {
     52    teb = GetThreadTEB();
     53    if(teb == 0) {
    5454        SetLastError(ERROR_INVALID_HANDLE); //todo
    5555        return 0;
    5656    }
    57     return thdb->hThread;
     57    return teb->o.odin.hThread;
    5858}
    5959//******************************************************************************
     
    6262{
    6363 EXCEPTION_FRAME *exceptFrame;
    64  THDB            *thdb;
     64 TEB             *teb;
    6565
    6666  dprintf(("ExitThread %x (%x)", GetCurrentThread(), exitcode));
    6767
    68   thdb = GetThreadTHDB();
    69   if(thdb != 0) {
    70         exceptFrame = (EXCEPTION_FRAME *)thdb->exceptFrame;
     68  teb = GetThreadTEB();
     69  if(teb != 0) {
     70        exceptFrame = (EXCEPTION_FRAME *)teb->o.odin.exceptFrame;
    7171  }
    7272  else  DebugInt3();
     
    113113  winteb->flags = me->dwFlags;
    114114
    115   THDB *thdb   = (THDB *)(winteb+1);
    116   thdb->entry_point = (void *)winthread;
    117   thdb->entry_arg   = (void *)userdata;
    118   thdb->hThread     = hThread;
     115  winteb->entry_point = (void *)winthread;
     116  winteb->entry_arg   = (void *)userdata;
     117  winteb->o.odin.hThread = hThread;
    119118
    120   thdb->hab = OSLibWinInitialize();
    121   thdb->hmq = OSLibWinQueryMsgQueue(thdb->hab);
    122   dprintf(("Win32ThreadProc: hab %x hmq %x", thdb->hab, thdb->hmq));
     119  winteb->o.odin.hab = OSLibWinInitialize();
     120  winteb->o.odin.hmq = OSLibWinQueryMsgQueue(winteb->o.odin.hab);
     121  dprintf(("Win32ThreadProc: hab %x hmq %x", winteb->o.odin.hab, winteb->o.odin.hmq));
    123122
    124123  //Note: The Win32 exception structure referenced by FS:[0] is the same
    125124  //      in OS/2
    126125  OS2SetExceptionHandler((void *)&exceptFrame);
    127   thdb->exceptFrame = (ULONG)&exceptFrame;
     126  winteb->o.odin.exceptFrame = (ULONG)&exceptFrame;
    128127
    129128  SetWin32TIB();
     
    137136
    138137  HMSetThreadTerminated(GetCurrentThread());
    139   thdb->exceptFrame = 0;
     138  winteb->o.odin.exceptFrame = 0;
    140139  Win32DllBase::detachThreadFromAllDlls();  //send DLL_THREAD_DETACH message to all dlls
    141140  Win32DllBase::tlsDetachThreadFromAllDlls(); //destroy TLS structures of all dlls
Note: See TracChangeset for help on using the changeset viewer.