Changeset 4658 for trunk/src/user32


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

Updates for TEB changes

Location:
trunk/src/user32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/HOOK.CPP

    r4430 r4658  
    1 /* $Id: HOOK.CPP,v 1.15 2000-10-05 13:47:06 sandervl Exp $ */
     1/* $Id: HOOK.CPP,v 1.16 2000-11-21 11:36:07 sandervl Exp $ */
    22
    33/*
     
    240240  MESSAGEQUEUE *queue;
    241241  HANDLE hook = 0;
    242   THDB *thdb;
    243 
    244     thdb = GetTHDBFromThreadId(threadId);
    245     if(thdb) {
    246         hook = thdb->hooks[id - WH_MINHOOK];
     242  TEB *teb;
     243
     244    teb = GetTEBFromThreadId(threadId);
     245    if(teb) {
     246        hook = teb->o.odin.hooks[id - WH_MINHOOK];
    247247    }
    248248    if (!hook) hook = HOOK_systemHooks[id - WH_MINHOOK];
     
    261261{
    262262  HOOKDATA *data;
    263   THDB     *thdb;
     263  TEB      *teb;
    264264
    265265    if ((id < WH_MINHOOK) || (id > WH_MAXHOOK) || !proc )
     
    301301    if(dwThreadId)
    302302    {
    303         thdb = GetTHDBFromThreadId(dwThreadId);
    304         if(!thdb) {
     303        teb = GetTEBFromThreadId(dwThreadId);
     304        if(!teb) {
    305305                dprintf(("HOOK_SetHook: can't find thread database for thread %x", dwThreadId));
    306306                return 0;
    307307        }
    308308        threadHookMutex.enter();
    309         data->next = thdb->hooks[id - WH_MINHOOK];
    310         thdb->hooks[id - WH_MINHOOK] = (DWORD)data;
     309        data->next = teb->o.odin.hooks[id - WH_MINHOOK];
     310        teb->o.odin.hooks[id - WH_MINHOOK] = (DWORD)data;
    311311        threadHookMutex.leave();
    312312    }
     
    331331{
    332332  HOOKDATA **prevHook;
    333   THDB     *thdb;
     333  TEB       *teb;
    334334
    335335    dprintf(("Removing hook %08x\n", data));
     
    351351    if (data->ownerThread)
    352352    {
    353         thdb = GetTHDBFromThreadId(data->ownerThread);
    354         if(!thdb) {
     353        teb = GetTEBFromThreadId(data->ownerThread);
     354        if(!teb) {
    355355                dprintf(("HOOK_RemoveHook: can't find thread database for thread %x", data->ownerThread));
    356356                return FALSE;
    357357        }
    358358        threadHookMutex.enter();
    359         prevHook = (HOOKDATA **)&thdb->hooks[data->id - WH_MINHOOK];
     359        prevHook = (HOOKDATA **)&teb->o.odin.hooks[data->id - WH_MINHOOK];
    360360    }
    361361    else {
  • trunk/src/user32/oslibmsg.cpp

    r3525 r4658  
    1 /* $Id: oslibmsg.cpp,v 1.33 2000-05-12 18:09:40 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.34 2000-11-21 11:36:08 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    7878   WM_CHAR,          WINWM_KEYLAST,
    7979
    80    WM_COMMAND,       WINWM_COMMAND,
    81    WM_SYSCOMMAND,    WINWM_SYSCOMMAND,
    8280   //
    8381   WM_TIMER,         WINWM_TIMER,
    84    WM_INITMENU,      WINWM_INITMENU,
     82
    8583   //
    8684   WM_MOUSEMOVE,     WINWM_MOUSEMOVE,
     
    9997#define MAX_MSGTRANSTAB (sizeof(MsgTransTab)/sizeof(MsgTransTab[0]))
    10098
    101 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
    102 
    10399//******************************************************************************
    104100//******************************************************************************
     
    134130    }
    135131
    136     return 0;
     132    //not found, probaby WIN32APP_POSTMSG
     133    return WIN32APP_POSTMSG;
    137134}
    138135//******************************************************************************
     
    149146LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)
    150147{
    151  THDB *thdb;
     148 TEB  *teb;
    152149 QMSG  os2msg;
    153150 LONG  rc;
    154151
    155   thdb = GetThreadTHDB();
    156   if(thdb == NULL) {
     152  teb = GetThreadTEB();
     153  if(teb == NULL) {
    157154        DebugInt3();
    158155        return FALSE;
     
    162159  //  WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
    163160
    164   if(!memcmp(msg, &thdb->winmsg, sizeof(MSG)) || msg->hwnd == 0) {
    165         memcpy(&os2msg, &thdb->os2msg, sizeof(QMSG));
    166         thdb->os2msg.time = -1;
    167         thdb->winmsg.time = -1;
     161  if(!memcmp(msg, &teb->o.odin.winmsg, sizeof(MSG)) || msg->hwnd == 0) {
     162        memcpy(&os2msg, &teb->o.odin.os2msg, sizeof(QMSG));
     163        teb->o.odin.os2msg.time = -1;
     164        teb->o.odin.winmsg.time = -1;
    168165        if(msg->hwnd) {
    169                 thdb->nrOfMsgs = 1;
    170                 thdb->msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg
    171                 memcpy(&thdb->msg, msg, sizeof(MSG));
     166                teb->o.odin.nrOfMsgs = 1;
     167                teb->o.odin.msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg
     168                memcpy(&teb->o.odin.msg, msg, sizeof(MSG));
    172169        }
    173170        if(os2msg.hwnd || os2msg.msg == WM_QUIT) {
    174                 memset(&thdb->os2msg, 0, sizeof(thdb->os2msg));
    175                 memset(&thdb->winmsg, 0, sizeof(thdb->winmsg));
    176                 return (LONG)WinDispatchMsg(thdb->hab, &os2msg);
     171                memset(&teb->o.odin.os2msg, 0, sizeof(teb->o.odin.os2msg));
     172                memset(&teb->o.odin.winmsg, 0, sizeof(teb->o.odin.winmsg));
     173                return (LONG)WinDispatchMsg(teb->o.odin.hab, &os2msg);
    177174        }
    178175        //SvL: Don't dispatch messages sent by PostThreadMessage (correct??)
     
    192189{
    193190 BOOL rc, eaten;
    194  THDB *thdb;
     191 TEB  *teb;
    195192 QMSG  os2msg;
    196193 HWND  hwndOS2 = 0;
     194 ULONG filtermin, filtermax;
    197195
    198196  if(hwnd) {
     
    206204  }
    207205
    208   thdb = GetThreadTHDB();
    209   if(thdb == NULL) {
     206  teb = GetThreadTEB();
     207  if(teb == NULL) {
    210208        DebugInt3();
    211209        return TRUE;
    212210  }
    213211
    214   if(thdb->fTranslated && (!hwnd || hwnd == thdb->msgWCHAR.hwnd)) {
     212  if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) {
    215213        if(uMsgFilterMin) {
    216             if(thdb->msgWCHAR.message < uMsgFilterMin)
     214            if(teb->o.odin.msgWCHAR.message < uMsgFilterMin)
    217215                goto continuegetmsg;
    218216        }
    219217        if(uMsgFilterMax) {
    220             if(thdb->msgWCHAR.message > uMsgFilterMax)
     218            if(teb->o.odin.msgWCHAR.message > uMsgFilterMax)
    221219                goto continuegetmsg;
    222220        }
    223         thdb->fTranslated = FALSE;
    224         memcpy(pMsg, &thdb->msgWCHAR, sizeof(MSG));
    225         thdb->os2msg.msg  = 0;
    226         thdb->os2msg.hwnd = 0;
     221        teb->o.odin.fTranslated = FALSE;
     222        memcpy(pMsg, &teb->o.odin.msgWCHAR, sizeof(MSG));
     223        teb->o.odin.os2msg.msg  = 0;
     224        teb->o.odin.os2msg.hwnd = 0;
    227225        return (pMsg->message != WINWM_QUIT);
    228226  }
     
    230228continuegetmsg:
    231229  if(hwnd) {
     230        filtermin = TranslateWinMsg(uMsgFilterMin, TRUE);
     231        filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
     232        if(filtermin > filtermax) {
     233                ULONG tmp = filtermin;
     234                filtermin = filtermax;
     235                filtermax = filtermin;
     236        }
    232237        do {
    233             WinWaitMsg(thdb->hab, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE));
    234             rc = OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, PM_REMOVE_W, isUnicode);
     238                WinWaitMsg(teb->o.odin.hab, filtermin, filtermax);
     239                rc = OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, PM_REMOVE_W, isUnicode);
    235240        }
    236241        while(rc == FALSE);
     
    240245  else
    241246  {
    242     do {
    243         eaten = FALSE;
    244         rc = WinGetMsg(thdb->hab, &os2msg, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE), 0);
    245         if (os2msg.msg == WM_TIMER)
    246             eaten = TIMER_HandleTimer(&os2msg);
    247     } while (eaten);
    248   }
    249 
    250   OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
    251   memcpy(&thdb->os2msg, &os2msg, sizeof(QMSG));
    252   memcpy(&thdb->winmsg, pMsg, sizeof(MSG));
     247        filtermin = TranslateWinMsg(uMsgFilterMin, TRUE);
     248        filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
     249        if(filtermin > filtermax) {
     250                ULONG tmp = filtermin;
     251                filtermin = filtermax;
     252                filtermax = filtermin;
     253        }
     254        do {
     255                eaten = FALSE;
     256                rc = WinGetMsg(teb->o.odin.hab, &os2msg, filtermin, filtermax, 0);
     257                if (os2msg.msg == WM_TIMER)
     258                    eaten = TIMER_HandleTimer(&os2msg);
     259        } while (eaten);
     260  }
     261
     262  OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE);
     263  memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG));
     264  memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG));
    253265
    254266  if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
     
    275287{
    276288 BOOL  rc, eaten;
    277  THDB *thdb;
     289 TEB  *teb;
    278290 QMSG  os2msg;
    279291 HWND  hwndOS2 = 0;
     
    288300  }
    289301
    290   thdb = GetThreadTHDB();
    291   if(thdb == NULL) {
     302  teb = GetThreadTEB();
     303  if(teb == NULL) {
    292304        DebugInt3();
    293305        return FALSE;
    294306  }
    295307
    296   if(thdb->fTranslated && (!hwnd || hwnd == thdb->msgWCHAR.hwnd)) {
     308  if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) {
    297309        if(uMsgFilterMin) {
    298             if(thdb->msgWCHAR.message < uMsgFilterMin)
     310            if(teb->o.odin.msgWCHAR.message < uMsgFilterMin)
    299311                goto continuepeekmsg;
    300312        }
    301313        if(uMsgFilterMax) {
    302             if(thdb->msgWCHAR.message > uMsgFilterMax)
     314            if(teb->o.odin.msgWCHAR.message > uMsgFilterMax)
    303315                goto continuepeekmsg;
    304316        }
    305317
    306318        if(fRemove & PM_REMOVE_W) {
    307             thdb->fTranslated = FALSE;
    308             thdb->os2msg.msg  = 0;
    309             thdb->os2msg.hwnd = 0;
    310         }
    311         memcpy(pMsg, &thdb->msgWCHAR, sizeof(MSG));
     319            teb->o.odin.fTranslated = FALSE;
     320            teb->o.odin.os2msg.msg  = 0;
     321            teb->o.odin.os2msg.hwnd = 0;
     322        }
     323        memcpy(pMsg, &teb->o.odin.msgWCHAR, sizeof(MSG));
    312324        return TRUE;
    313325  }
     
    316328  do {
    317329        eaten = FALSE;
    318         rc = WinPeekMsg(thdb->hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
     330        rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
    319331                        TranslateWinMsg(uMsgFilterMax, FALSE), (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
    320332
     
    329341  }
    330342
    331   OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, (fRemove & PM_REMOVE_W) ? MSG_REMOVE : MSG_NOREMOVE);
     343  OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, (fRemove & PM_REMOVE_W) ? MSG_REMOVE : MSG_NOREMOVE);
    332344  //TODO: This is not safe! There's no guarantee this message will be dispatched and it might overwrite a previous message
    333345  if(fRemove & PM_REMOVE_W) {
    334         memcpy(&thdb->os2msg, &os2msg, sizeof(QMSG));
    335         memcpy(&thdb->winmsg, pMsg, sizeof(MSG));
     346        memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG));
     347        memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG));
    336348  }
    337349
     
    460472BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
    461473{
    462 // THDB *thdb = GetTHDBFromThreadId(threadid);
     474// TEB *teb = GetTEBFromThreadId(threadid);
    463475 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
    464476
    465 //    if(thdb == NULL) {
     477//    if(teb == NULL) {
    466478//        dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));
    467479//        return FALSE;
  • trunk/src/user32/oslibmsgtranslate.cpp

    r4599 r4658  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.38 2000-11-15 20:30:46 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.39 2000-11-21 11:36:08 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    132132//******************************************************************************
    133133//******************************************************************************
    134 BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved)
     134BOOL OS2ToWinMsgTranslate(void *pTeb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved)
    135135{
    136136  Win32BaseWindow *win32wnd = 0;
    137137  OSLIBPOINT       point, ClientPoint;
    138138  POSTMSG_PACKET  *packet;
    139   THDB            *thdb = (THDB *)pThdb;
     139  TEB             *teb = (TEB *)pTeb;
    140140  BOOL             fWasDisabled = FALSE;
    141141  int i;
     
    176176    case WM_CREATE:
    177177    {
    178         if(thdb->newWindow == 0) {
     178        if(teb->o.odin.newWindow == 0) {
    179179            DebugInt3();
    180180            goto dummymessage;
    181181        }
    182182
    183         win32wnd = (Win32BaseWindow *)thdb->newWindow;
     183        win32wnd = (Win32BaseWindow *)teb->o.odin.newWindow;
    184184
    185185        winMsg->message = WINWM_CREATE;
     
    233233        }
    234234        if(win32wnd->getParent()) {
    235               OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, win32wnd->getParent()->getWindowHeight(),
     235              OSLibMapSWPtoWINDOWPOS(pswp, &teb->o.odin.wp, &swpOld, win32wnd->getParent()->getWindowHeight(),
    236236                                     win32wnd->getParent()->getClientRectPtr()->left,
    237237                                     win32wnd->getParent()->getClientRectPtr()->top,
    238238                                     win32wnd->getOS2WindowHandle());
    239239        }
    240         else  OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, win32wnd->getOS2WindowHandle());
     240        else  OSLibMapSWPtoWINDOWPOS(pswp, &teb->o.odin.wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, win32wnd->getOS2WindowHandle());
    241241
    242242        if (!win32wnd->CanReceiveSizeMsgs())    goto dummymessage;
     
    246246/////                win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    247247
    248                 thdb->wp.hwnd = win32wnd->getWindowHandle();
     248                teb->o.odin.wp.hwnd = win32wnd->getWindowHandle();
    249249                if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    250250                {
    251251                        Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    252252                        if(wndAfter)
    253                               thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
    254                         else  thdb->wp.hwndInsertAfter = HWND_TOP_W;
     253                              teb->o.odin.wp.hwndInsertAfter = wndAfter->getWindowHandle();
     254                        else  teb->o.odin.wp.hwndInsertAfter = HWND_TOP_W;
    255255                }
    256256        }
    257257        winMsg->message = WINWM_WINDOWPOSCHANGED;
    258         winMsg->lParam  = (LPARAM)&thdb->wp;
     258        winMsg->lParam  = (LPARAM)&teb->o.odin.wp;
    259259        break;
    260260    }
     
    496496        char c;
    497497
    498         thdb->fTranslated = FALSE;
     498        teb->o.odin.fTranslated = FALSE;
    499499        repeatCount = CHAR3FROMMP(os2Msg->mp1);
    500500        scanCode = CHAR4FROMMP(os2Msg->mp1);
     
    694694    case WM_RENDERALLFMTS:
    695695        winMsg->message = WINWM_RENDERALLFORMATS;
     696        break;
     697
     698    case WM_DESTROYCLIPBOARD:
     699        winMsg->message = WINWM_DESTROYCLIPBOARD;
    696700        break;
    697701
     
    733737BOOL OSLibWinTranslateMessage(MSG *msg)
    734738{
    735  THDB *thdb;
    736 
    737     thdb = GetThreadTHDB();
    738     if(!thdb) {
     739 TEB *teb;
     740
     741    teb = GetThreadTEB();
     742    if(!teb) {
    739743        return FALSE;
    740744    }
    741745    //NOTE: These actually need to be posted so that the next message retrieved by GetMessage contains
    742746    //      the newly generated WM_CHAR message.
    743     if(!thdb->fTranslated && thdb->os2msg.msg == WM_CHAR && !((SHORT1FROMMP(thdb->os2msg.mp1) & KC_KEYUP) == KC_KEYUP))
     747    if(!teb->o.odin.fTranslated && teb->o.odin.os2msg.msg == WM_CHAR && !((SHORT1FROMMP(teb->o.odin.os2msg.mp1) & KC_KEYUP) == KC_KEYUP))
    744748    {//TranslatedMessage was called before DispatchMessage, so queue WM_CHAR message
    745             ULONG fl = SHORT1FROMMP(thdb->os2msg.mp1);
     749            ULONG fl = SHORT1FROMMP(teb->o.odin.os2msg.mp1);
    746750            MSG extramsg;
    747751
    748752            memcpy(&extramsg, msg, sizeof(MSG));
    749             extramsg.wParam = SHORT1FROMMP(thdb->os2msg.mp2);
     753            extramsg.wParam = SHORT1FROMMP(teb->o.odin.os2msg.mp2);
    750754            extramsg.lParam = 0;
    751755
     
    757761                if(msg->wParam)
    758762                        extramsg.wParam = msg->wParam;
    759                 else    extramsg.wParam = SHORT2FROMMP(thdb->os2msg.mp2);
     763                else    extramsg.wParam = SHORT2FROMMP(teb->o.odin.os2msg.mp2);
    760764            }
    761765
     
    778782                extramsg.lParam |= (1<<31);
    779783
    780             thdb->fTranslated = TRUE;
    781             memcpy(&thdb->msgWCHAR, &extramsg, sizeof(MSG));
     784            teb->o.odin.fTranslated = TRUE;
     785            memcpy(&teb->o.odin.msgWCHAR, &extramsg, sizeof(MSG));
    782786            return TRUE;
    783787    }
  • trunk/src/user32/oslibutil.cpp

    r2804 r4658  
    1 /* $Id: oslibutil.cpp,v 1.5 2000-02-16 14:34:28 sandervl Exp $ */
     1/* $Id: oslibutil.cpp,v 1.6 2000-11-21 11:36:08 sandervl Exp $ */
    22/*
    33 * Window API utility functions for OS/2
     
    2222HAB GetThreadHAB()
    2323{
    24  THDB *thdb;
     24 TEB *teb;
    2525
    26   thdb = GetThreadTHDB();
    27   if(thdb)
     26  teb = GetThreadTEB();
     27  if(teb)
    2828  {
    29         return (HAB)thdb->hab;
     29        return (HAB)teb->o.odin.hab;
    3030  }
    3131
    32   dprintf(("GetThreadHAB: thdb == NULL!!"));
     32  dprintf(("GetThreadHAB: teb == NULL!!"));
    3333  return 0;
    3434}
     
    3737void SetThreadHAB(HAB hab)
    3838{
    39  THDB *thdb;
     39 TEB *teb;
    4040
    41   thdb = GetThreadTHDB();
    42   if(thdb)
     41  teb = GetThreadTEB();
     42  if(teb)
    4343  {
    44         thdb->hab = (ULONG)hab;
     44        teb->o.odin.hab = (ULONG)hab;
    4545  }
    46   else  dprintf(("SetThreadHAB: thdb == NULL!!"));
     46  else  dprintf(("SetThreadHAB: teb == NULL!!"));
    4747}
    4848//******************************************************************************
     
    5050HMQ GetThreadMessageQueue()
    5151{
    52  THDB *thdb;
     52 TEB *teb;
    5353
    54   thdb = GetThreadTHDB();
    55   if(thdb)
     54  teb = GetThreadTEB();
     55  if(teb)
    5656  {
    57         return (HMQ)thdb->hmq;
     57        return (HMQ)teb->o.odin.hmq;
    5858  }
    5959
    60   dprintf(("GetThreadMessageQueue: thdb == NULL!!"));
     60  dprintf(("GetThreadMessageQueue: teb == NULL!!"));
    6161  return 0;
    6262}
     
    6565void SetThreadMessageQueue(HMQ hmq)
    6666{
    67  THDB *thdb;
     67 TEB *teb;
    6868
    69   thdb = GetThreadTHDB();
    70   if(thdb)
     69  teb = GetThreadTEB();
     70  if(teb)
    7171  {
    72         thdb->hmq = (ULONG)hmq;
     72        teb->o.odin.hmq = (ULONG)hmq;
    7373  }
    74   else  dprintf(("SetThreadMessageQueue: thdb == NULL!!"));
     74  else  dprintf(("SetThreadMessageQueue: teb == NULL!!"));
    7575}
    7676//******************************************************************************
     
    7878DWORD GetThreadMessageExtraInfo()
    7979{
    80  THDB *thdb;
     80 TEB *teb;
    8181
    82   thdb = GetThreadTHDB();
    83   if(thdb)
     82  teb = GetThreadTEB();
     83  if(teb)
    8484  {
    85         return thdb->lParam;
     85        return teb->o.odin.lParam;
    8686  }
    8787
    88   dprintf(("GetThreadMessageExtraInfo: thdb == NULL!!"));
     88  dprintf(("GetThreadMessageExtraInfo: teb == NULL!!"));
    8989  return 0;
    9090}
     
    9393DWORD SetThreadMessageExtraInfo(DWORD lParam)
    9494{
    95  THDB *thdb;
     95 TEB *teb;
    9696
    97   thdb = GetThreadTHDB();
    98   if(thdb)
     97  teb = GetThreadTEB();
     98  if(teb)
    9999  {
    100         thdb->lParam = lParam;
     100        teb->o.odin.lParam = lParam;
    101101  }
    102   else  dprintf(("SetThreadMessageExtraInfo: thdb == NULL!!"));
     102  else  dprintf(("SetThreadMessageExtraInfo: teb == NULL!!"));
    103103  return 0;
    104104}
  • trunk/src/user32/pmframe.cpp

    r3603 r4658  
    1 /* $Id: pmframe.cpp,v 1.55 2000-05-24 19:30:05 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.56 2000-11-21 11:36:08 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    6868 PFNWP            OldFrameProc;
    6969 MRESULT          rc;
    70  THDB            *thdb;
     70 TEB             *teb;
    7171 MSG             *pWinMsg,winMsg;
    7272
    7373  SetWin32TIB();
    7474
    75   thdb = GetThreadTHDB();
     75  teb = GetThreadTEB();
    7676  win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd);
    7777
    78   if (!thdb || (win32wnd == NULL) || !win32wnd->getOldFrameProc())
     78  if (!teb || (win32wnd == NULL) || !win32wnd->getOldFrameProc())
    7979  {
    8080    dprintf(("Invalid win32wnd pointer for frame %x!!", hwnd));
     
    8282  }
    8383
    84   if((thdb->msgstate & 1) == 0)
     84  if((teb->o.odin.msgstate & 1) == 0)
    8585  {//message that was sent directly to our window proc handler; translate it here
    8686        QMSG qmsg;
     
    9090        qmsg.mp1  = mp1;
    9191        qmsg.mp2  = mp2;
    92         qmsg.time = WinQueryMsgTime(thdb->hab);
    93         WinQueryMsgPos(thdb->hab, &qmsg.ptl);
     92        qmsg.time = WinQueryMsgTime(teb->o.odin.hab);
     93        WinQueryMsgPos(teb->o.odin.hab, &qmsg.ptl);
    9494        qmsg.reserved = 0;
    9595
    96         if(OS2ToWinMsgTranslate((PVOID)thdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)
     96        if(OS2ToWinMsgTranslate((PVOID)teb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)
    9797        {//message was not translated
    9898            memset(&winMsg, 0, sizeof(MSG));
     
    101101  }
    102102  else {
    103         pWinMsg = &thdb->msg;
    104         thdb->msgstate++;
     103        pWinMsg = &teb->o.odin.msg;
     104        teb->o.odin.msgstate++;
    105105  }
    106106
     
    357357          //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now
    358358          swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW;
    359           WinSetMultWindowPos(thdb->hab, &swpClient, 1);
     359          WinSetMultWindowPos(teb->o.odin.hab, &swpClient, 1);
    360360
    361361          //update child positions: rectWindow is in window coordinates
  • trunk/src/user32/pmwindow.cpp

    r4599 r4658  
    1 /* $Id: pmwindow.cpp,v 1.107 2000-11-15 20:30:46 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.108 2000-11-21 11:36:09 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    144144 OSLIBPOINT       point, ClientPoint;
    145145 Win32BaseWindow *win32wnd;
    146  THDB            *thdb;
     146 TEB             *teb;
    147147 APIRET           rc = 0;
    148148 MSG              winMsg, *pWinMsg;
     
    151151  SetWin32TIB();
    152152
    153   thdb = GetThreadTHDB();
     153  teb = GetThreadTEB();
    154154  win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    155155
    156   if(!thdb || (msg != WM_CREATE && win32wnd == NULL)) {
     156  if(!teb || (msg != WM_CREATE && win32wnd == NULL)) {
    157157        dprintf(("Invalid win32wnd pointer for window %x msg %x", hwnd, msg));
    158158        goto RunDefWndProc;
    159159  }
    160160
    161   if((thdb->msgstate & 1) == 0)
     161  if((teb->o.odin.msgstate & 1) == 0)
    162162  {//message that was sent directly to our window proc handler; translate it here
    163163        QMSG qmsg;
     
    167167        qmsg.mp1  = mp1;
    168168        qmsg.mp2  = mp2;
    169         qmsg.time = WinQueryMsgTime(thdb->hab);
    170         WinQueryMsgPos(thdb->hab, &qmsg.ptl);
     169        qmsg.time = WinQueryMsgTime(teb->o.odin.hab);
     170        WinQueryMsgPos(teb->o.odin.hab, &qmsg.ptl);
    171171        qmsg.reserved = 0;
    172172
    173         if(OS2ToWinMsgTranslate((PVOID)thdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)
     173        if(OS2ToWinMsgTranslate((PVOID)teb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)
    174174        {//message was not translated
    175175            memset(&winMsg, 0, sizeof(MSG));
     
    178178  }
    179179  else {
    180         pWinMsg = &thdb->msg;
    181         thdb->msgstate++;
     180        pWinMsg = &teb->o.odin.msg;
     181        teb->o.odin.msgstate++;
    182182  }
    183183
     
    197197    case WM_CREATE:
    198198    {
    199         if(thdb->newWindow == 0)
     199        if(teb->o.odin.newWindow == 0)
    200200            goto createfail;
    201201
    202202        //Processing is done in after WinCreateWindow returns
    203203        dprintf(("OS2: WM_CREATE %x", hwnd));
    204         win32wnd = (Win32BaseWindow *)thdb->newWindow;
    205         thdb->newWindow = 0;
     204        win32wnd = (Win32BaseWindow *)teb->o.odin.newWindow;
     205        teb->o.odin.newWindow = 0;
    206206        if(win32wnd->MsgCreate(hwnd) == FALSE)
    207207        {
     
    794794    case WM_RENDERFMT:
    795795    case WM_RENDERALLFMTS:
     796    case WM_DESTROYCLIPBOARD:
    796797        win32wnd->DispatchMsgA(pWinMsg);
    797798        break;
  • trunk/src/user32/win32wbase.cpp

    r4628 r4658  
    1 /* $Id: win32wbase.cpp,v 1.223 2000-11-19 11:52:40 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.224 2000-11-21 11:36:09 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    496496
    497497  //Store our window object pointer in thread local memory, so PMWINDOW.CPP can retrieve it
    498   THDB *thdb = GetThreadTHDB();
    499 
    500   if(thdb == NULL) {
    501         dprintf(("Window creation failed - thdb == NULL")); //this is VERY bad
     498  TEB *teb = GetThreadTEB();
     499
     500  if(teb == NULL) {
     501        dprintf(("Window creation failed - teb == NULL")); //this is VERY bad
    502502        ExitProcess(666);
    503503        return FALSE;
    504504  }
    505505
    506   thdb->newWindow = (ULONG)this;
     506  teb->o.odin.newWindow = (ULONG)this;
    507507
    508508  DWORD dwOSWinStyle;
Note: See TracChangeset for help on using the changeset viewer.