Changeset 4658 for trunk/src/user32
- Timestamp:
- Nov 21, 2000, 12:36:09 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/HOOK.CPP
r4430 r4658 1 /* $Id: HOOK.CPP,v 1.1 5 2000-10-05 13:47:06sandervl Exp $ */1 /* $Id: HOOK.CPP,v 1.16 2000-11-21 11:36:07 sandervl Exp $ */ 2 2 3 3 /* … … 240 240 MESSAGEQUEUE *queue; 241 241 HANDLE hook = 0; 242 T HDB *thdb;243 244 t hdb = GetTHDBFromThreadId(threadId);245 if(t hdb) {246 hook = t hdb->hooks[id - WH_MINHOOK];242 TEB *teb; 243 244 teb = GetTEBFromThreadId(threadId); 245 if(teb) { 246 hook = teb->o.odin.hooks[id - WH_MINHOOK]; 247 247 } 248 248 if (!hook) hook = HOOK_systemHooks[id - WH_MINHOOK]; … … 261 261 { 262 262 HOOKDATA *data; 263 T HDB *thdb;263 TEB *teb; 264 264 265 265 if ((id < WH_MINHOOK) || (id > WH_MAXHOOK) || !proc ) … … 301 301 if(dwThreadId) 302 302 { 303 t hdb = GetTHDBFromThreadId(dwThreadId);304 if(!t hdb) {303 teb = GetTEBFromThreadId(dwThreadId); 304 if(!teb) { 305 305 dprintf(("HOOK_SetHook: can't find thread database for thread %x", dwThreadId)); 306 306 return 0; 307 307 } 308 308 threadHookMutex.enter(); 309 data->next = t hdb->hooks[id - WH_MINHOOK];310 t hdb->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; 311 311 threadHookMutex.leave(); 312 312 } … … 331 331 { 332 332 HOOKDATA **prevHook; 333 T HDB *thdb;333 TEB *teb; 334 334 335 335 dprintf(("Removing hook %08x\n", data)); … … 351 351 if (data->ownerThread) 352 352 { 353 t hdb = GetTHDBFromThreadId(data->ownerThread);354 if(!t hdb) {353 teb = GetTEBFromThreadId(data->ownerThread); 354 if(!teb) { 355 355 dprintf(("HOOK_RemoveHook: can't find thread database for thread %x", data->ownerThread)); 356 356 return FALSE; 357 357 } 358 358 threadHookMutex.enter(); 359 prevHook = (HOOKDATA **)&t hdb->hooks[data->id - WH_MINHOOK];359 prevHook = (HOOKDATA **)&teb->o.odin.hooks[data->id - WH_MINHOOK]; 360 360 } 361 361 else { -
trunk/src/user32/oslibmsg.cpp
r3525 r4658 1 /* $Id: oslibmsg.cpp,v 1.3 3 2000-05-12 18:09:40sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.34 2000-11-21 11:36:08 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 78 78 WM_CHAR, WINWM_KEYLAST, 79 79 80 WM_COMMAND, WINWM_COMMAND,81 WM_SYSCOMMAND, WINWM_SYSCOMMAND,82 80 // 83 81 WM_TIMER, WINWM_TIMER, 84 WM_INITMENU, WINWM_INITMENU, 82 85 83 // 86 84 WM_MOUSEMOVE, WINWM_MOUSEMOVE, … … 99 97 #define MAX_MSGTRANSTAB (sizeof(MsgTransTab)/sizeof(MsgTransTab[0])) 100 98 101 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);102 103 99 //****************************************************************************** 104 100 //****************************************************************************** … … 134 130 } 135 131 136 return 0; 132 //not found, probaby WIN32APP_POSTMSG 133 return WIN32APP_POSTMSG; 137 134 } 138 135 //****************************************************************************** … … 149 146 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode) 150 147 { 151 T HDB *thdb;148 TEB *teb; 152 149 QMSG os2msg; 153 150 LONG rc; 154 151 155 t hdb = GetThreadTHDB();156 if(t hdb == NULL) {152 teb = GetThreadTEB(); 153 if(teb == NULL) { 157 154 DebugInt3(); 158 155 return FALSE; … … 162 159 // WinToOS2MsgTranslate(msg, &qmsg, isUnicode); 163 160 164 if(!memcmp(msg, &t hdb->winmsg, sizeof(MSG)) || msg->hwnd == 0) {165 memcpy(&os2msg, &t hdb->os2msg, sizeof(QMSG));166 t hdb->os2msg.time = -1;167 t hdb->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; 168 165 if(msg->hwnd) { 169 t hdb->nrOfMsgs = 1;170 t hdb->msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg171 memcpy(&t hdb->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)); 172 169 } 173 170 if(os2msg.hwnd || os2msg.msg == WM_QUIT) { 174 memset(&t hdb->os2msg, 0, sizeof(thdb->os2msg));175 memset(&t hdb->winmsg, 0, sizeof(thdb->winmsg));176 return (LONG)WinDispatchMsg(t hdb->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); 177 174 } 178 175 //SvL: Don't dispatch messages sent by PostThreadMessage (correct??) … … 192 189 { 193 190 BOOL rc, eaten; 194 T HDB *thdb;191 TEB *teb; 195 192 QMSG os2msg; 196 193 HWND hwndOS2 = 0; 194 ULONG filtermin, filtermax; 197 195 198 196 if(hwnd) { … … 206 204 } 207 205 208 t hdb = GetThreadTHDB();209 if(t hdb == NULL) {206 teb = GetThreadTEB(); 207 if(teb == NULL) { 210 208 DebugInt3(); 211 209 return TRUE; 212 210 } 213 211 214 if(t hdb->fTranslated && (!hwnd || hwnd == thdb->msgWCHAR.hwnd)) {212 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) { 215 213 if(uMsgFilterMin) { 216 if(t hdb->msgWCHAR.message < uMsgFilterMin)214 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin) 217 215 goto continuegetmsg; 218 216 } 219 217 if(uMsgFilterMax) { 220 if(t hdb->msgWCHAR.message > uMsgFilterMax)218 if(teb->o.odin.msgWCHAR.message > uMsgFilterMax) 221 219 goto continuegetmsg; 222 220 } 223 t hdb->fTranslated = FALSE;224 memcpy(pMsg, &t hdb->msgWCHAR, sizeof(MSG));225 t hdb->os2msg.msg = 0;226 t hdb->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; 227 225 return (pMsg->message != WINWM_QUIT); 228 226 } … … 230 228 continuegetmsg: 231 229 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 } 232 237 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); 235 240 } 236 241 while(rc == FALSE); … … 240 245 else 241 246 { 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)); 253 265 254 266 if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN) … … 275 287 { 276 288 BOOL rc, eaten; 277 T HDB *thdb;289 TEB *teb; 278 290 QMSG os2msg; 279 291 HWND hwndOS2 = 0; … … 288 300 } 289 301 290 t hdb = GetThreadTHDB();291 if(t hdb == NULL) {302 teb = GetThreadTEB(); 303 if(teb == NULL) { 292 304 DebugInt3(); 293 305 return FALSE; 294 306 } 295 307 296 if(t hdb->fTranslated && (!hwnd || hwnd == thdb->msgWCHAR.hwnd)) {308 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) { 297 309 if(uMsgFilterMin) { 298 if(t hdb->msgWCHAR.message < uMsgFilterMin)310 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin) 299 311 goto continuepeekmsg; 300 312 } 301 313 if(uMsgFilterMax) { 302 if(t hdb->msgWCHAR.message > uMsgFilterMax)314 if(teb->o.odin.msgWCHAR.message > uMsgFilterMax) 303 315 goto continuepeekmsg; 304 316 } 305 317 306 318 if(fRemove & PM_REMOVE_W) { 307 t hdb->fTranslated = FALSE;308 t hdb->os2msg.msg = 0;309 t hdb->os2msg.hwnd = 0;310 } 311 memcpy(pMsg, &t hdb->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)); 312 324 return TRUE; 313 325 } … … 316 328 do { 317 329 eaten = FALSE; 318 rc = WinPeekMsg(t hdb->hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),330 rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE), 319 331 TranslateWinMsg(uMsgFilterMax, FALSE), (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE); 320 332 … … 329 341 } 330 342 331 OS2ToWinMsgTranslate((PVOID)t hdb, &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); 332 344 //TODO: This is not safe! There's no guarantee this message will be dispatched and it might overwrite a previous message 333 345 if(fRemove & PM_REMOVE_W) { 334 memcpy(&t hdb->os2msg, &os2msg, sizeof(QMSG));335 memcpy(&t hdb->winmsg, pMsg, sizeof(MSG));346 memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG)); 347 memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG)); 336 348 } 337 349 … … 460 472 BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode) 461 473 { 462 // T HDB *thdb = GetTHDBFromThreadId(threadid);474 // TEB *teb = GetTEBFromThreadId(threadid); 463 475 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 464 476 465 // if(t hdb == NULL) {477 // if(teb == NULL) { 466 478 // dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid)); 467 479 // return FALSE; -
trunk/src/user32/oslibmsgtranslate.cpp
r4599 r4658 1 /* $Id: oslibmsgtranslate.cpp,v 1.3 8 2000-11-15 20:30:46sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.39 2000-11-21 11:36:08 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 132 132 //****************************************************************************** 133 133 //****************************************************************************** 134 BOOL OS2ToWinMsgTranslate(void *pT hdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved)134 BOOL OS2ToWinMsgTranslate(void *pTeb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved) 135 135 { 136 136 Win32BaseWindow *win32wnd = 0; 137 137 OSLIBPOINT point, ClientPoint; 138 138 POSTMSG_PACKET *packet; 139 T HDB *thdb = (THDB *)pThdb;139 TEB *teb = (TEB *)pTeb; 140 140 BOOL fWasDisabled = FALSE; 141 141 int i; … … 176 176 case WM_CREATE: 177 177 { 178 if(t hdb->newWindow == 0) {178 if(teb->o.odin.newWindow == 0) { 179 179 DebugInt3(); 180 180 goto dummymessage; 181 181 } 182 182 183 win32wnd = (Win32BaseWindow *)t hdb->newWindow;183 win32wnd = (Win32BaseWindow *)teb->o.odin.newWindow; 184 184 185 185 winMsg->message = WINWM_CREATE; … … 233 233 } 234 234 if(win32wnd->getParent()) { 235 OSLibMapSWPtoWINDOWPOS(pswp, &t hdb->wp, &swpOld, win32wnd->getParent()->getWindowHeight(),235 OSLibMapSWPtoWINDOWPOS(pswp, &teb->o.odin.wp, &swpOld, win32wnd->getParent()->getWindowHeight(), 236 236 win32wnd->getParent()->getClientRectPtr()->left, 237 237 win32wnd->getParent()->getClientRectPtr()->top, 238 238 win32wnd->getOS2WindowHandle()); 239 239 } 240 else OSLibMapSWPtoWINDOWPOS(pswp, &t hdb->wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, win32wnd->getOS2WindowHandle());240 else OSLibMapSWPtoWINDOWPOS(pswp, &teb->o.odin.wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, win32wnd->getOS2WindowHandle()); 241 241 242 242 if (!win32wnd->CanReceiveSizeMsgs()) goto dummymessage; … … 246 246 ///// win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 247 247 248 t hdb->wp.hwnd = win32wnd->getWindowHandle();248 teb->o.odin.wp.hwnd = win32wnd->getWindowHandle(); 249 249 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 250 250 { 251 251 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 252 252 if(wndAfter) 253 t hdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();254 else t hdb->wp.hwndInsertAfter = HWND_TOP_W;253 teb->o.odin.wp.hwndInsertAfter = wndAfter->getWindowHandle(); 254 else teb->o.odin.wp.hwndInsertAfter = HWND_TOP_W; 255 255 } 256 256 } 257 257 winMsg->message = WINWM_WINDOWPOSCHANGED; 258 winMsg->lParam = (LPARAM)&t hdb->wp;258 winMsg->lParam = (LPARAM)&teb->o.odin.wp; 259 259 break; 260 260 } … … 496 496 char c; 497 497 498 t hdb->fTranslated = FALSE;498 teb->o.odin.fTranslated = FALSE; 499 499 repeatCount = CHAR3FROMMP(os2Msg->mp1); 500 500 scanCode = CHAR4FROMMP(os2Msg->mp1); … … 694 694 case WM_RENDERALLFMTS: 695 695 winMsg->message = WINWM_RENDERALLFORMATS; 696 break; 697 698 case WM_DESTROYCLIPBOARD: 699 winMsg->message = WINWM_DESTROYCLIPBOARD; 696 700 break; 697 701 … … 733 737 BOOL OSLibWinTranslateMessage(MSG *msg) 734 738 { 735 T HDB *thdb;736 737 t hdb = GetThreadTHDB();738 if(!t hdb) {739 TEB *teb; 740 741 teb = GetThreadTEB(); 742 if(!teb) { 739 743 return FALSE; 740 744 } 741 745 //NOTE: These actually need to be posted so that the next message retrieved by GetMessage contains 742 746 // the newly generated WM_CHAR message. 743 if(!t hdb->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)) 744 748 {//TranslatedMessage was called before DispatchMessage, so queue WM_CHAR message 745 ULONG fl = SHORT1FROMMP(t hdb->os2msg.mp1);749 ULONG fl = SHORT1FROMMP(teb->o.odin.os2msg.mp1); 746 750 MSG extramsg; 747 751 748 752 memcpy(&extramsg, msg, sizeof(MSG)); 749 extramsg.wParam = SHORT1FROMMP(t hdb->os2msg.mp2);753 extramsg.wParam = SHORT1FROMMP(teb->o.odin.os2msg.mp2); 750 754 extramsg.lParam = 0; 751 755 … … 757 761 if(msg->wParam) 758 762 extramsg.wParam = msg->wParam; 759 else extramsg.wParam = SHORT2FROMMP(t hdb->os2msg.mp2);763 else extramsg.wParam = SHORT2FROMMP(teb->o.odin.os2msg.mp2); 760 764 } 761 765 … … 778 782 extramsg.lParam |= (1<<31); 779 783 780 t hdb->fTranslated = TRUE;781 memcpy(&t hdb->msgWCHAR, &extramsg, sizeof(MSG));784 teb->o.odin.fTranslated = TRUE; 785 memcpy(&teb->o.odin.msgWCHAR, &extramsg, sizeof(MSG)); 782 786 return TRUE; 783 787 } -
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 $ */ 2 2 /* 3 3 * Window API utility functions for OS/2 … … 22 22 HAB GetThreadHAB() 23 23 { 24 T HDB *thdb;24 TEB *teb; 25 25 26 t hdb = GetThreadTHDB();27 if(t hdb)26 teb = GetThreadTEB(); 27 if(teb) 28 28 { 29 return (HAB)t hdb->hab;29 return (HAB)teb->o.odin.hab; 30 30 } 31 31 32 dprintf(("GetThreadHAB: t hdb == NULL!!"));32 dprintf(("GetThreadHAB: teb == NULL!!")); 33 33 return 0; 34 34 } … … 37 37 void SetThreadHAB(HAB hab) 38 38 { 39 T HDB *thdb;39 TEB *teb; 40 40 41 t hdb = GetThreadTHDB();42 if(t hdb)41 teb = GetThreadTEB(); 42 if(teb) 43 43 { 44 t hdb->hab = (ULONG)hab;44 teb->o.odin.hab = (ULONG)hab; 45 45 } 46 else dprintf(("SetThreadHAB: t hdb == NULL!!"));46 else dprintf(("SetThreadHAB: teb == NULL!!")); 47 47 } 48 48 //****************************************************************************** … … 50 50 HMQ GetThreadMessageQueue() 51 51 { 52 T HDB *thdb;52 TEB *teb; 53 53 54 t hdb = GetThreadTHDB();55 if(t hdb)54 teb = GetThreadTEB(); 55 if(teb) 56 56 { 57 return (HMQ)t hdb->hmq;57 return (HMQ)teb->o.odin.hmq; 58 58 } 59 59 60 dprintf(("GetThreadMessageQueue: t hdb == NULL!!"));60 dprintf(("GetThreadMessageQueue: teb == NULL!!")); 61 61 return 0; 62 62 } … … 65 65 void SetThreadMessageQueue(HMQ hmq) 66 66 { 67 T HDB *thdb;67 TEB *teb; 68 68 69 t hdb = GetThreadTHDB();70 if(t hdb)69 teb = GetThreadTEB(); 70 if(teb) 71 71 { 72 t hdb->hmq = (ULONG)hmq;72 teb->o.odin.hmq = (ULONG)hmq; 73 73 } 74 else dprintf(("SetThreadMessageQueue: t hdb == NULL!!"));74 else dprintf(("SetThreadMessageQueue: teb == NULL!!")); 75 75 } 76 76 //****************************************************************************** … … 78 78 DWORD GetThreadMessageExtraInfo() 79 79 { 80 T HDB *thdb;80 TEB *teb; 81 81 82 t hdb = GetThreadTHDB();83 if(t hdb)82 teb = GetThreadTEB(); 83 if(teb) 84 84 { 85 return t hdb->lParam;85 return teb->o.odin.lParam; 86 86 } 87 87 88 dprintf(("GetThreadMessageExtraInfo: t hdb == NULL!!"));88 dprintf(("GetThreadMessageExtraInfo: teb == NULL!!")); 89 89 return 0; 90 90 } … … 93 93 DWORD SetThreadMessageExtraInfo(DWORD lParam) 94 94 { 95 T HDB *thdb;95 TEB *teb; 96 96 97 t hdb = GetThreadTHDB();98 if(t hdb)97 teb = GetThreadTEB(); 98 if(teb) 99 99 { 100 t hdb->lParam = lParam;100 teb->o.odin.lParam = lParam; 101 101 } 102 else dprintf(("SetThreadMessageExtraInfo: t hdb == NULL!!"));102 else dprintf(("SetThreadMessageExtraInfo: teb == NULL!!")); 103 103 return 0; 104 104 } -
trunk/src/user32/pmframe.cpp
r3603 r4658 1 /* $Id: pmframe.cpp,v 1.5 5 2000-05-24 19:30:05sandervl Exp $ */1 /* $Id: pmframe.cpp,v 1.56 2000-11-21 11:36:08 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 68 68 PFNWP OldFrameProc; 69 69 MRESULT rc; 70 T HDB *thdb;70 TEB *teb; 71 71 MSG *pWinMsg,winMsg; 72 72 73 73 SetWin32TIB(); 74 74 75 t hdb = GetThreadTHDB();75 teb = GetThreadTEB(); 76 76 win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd); 77 77 78 if (!t hdb || (win32wnd == NULL) || !win32wnd->getOldFrameProc())78 if (!teb || (win32wnd == NULL) || !win32wnd->getOldFrameProc()) 79 79 { 80 80 dprintf(("Invalid win32wnd pointer for frame %x!!", hwnd)); … … 82 82 } 83 83 84 if((t hdb->msgstate & 1) == 0)84 if((teb->o.odin.msgstate & 1) == 0) 85 85 {//message that was sent directly to our window proc handler; translate it here 86 86 QMSG qmsg; … … 90 90 qmsg.mp1 = mp1; 91 91 qmsg.mp2 = mp2; 92 qmsg.time = WinQueryMsgTime(t hdb->hab);93 WinQueryMsgPos(t hdb->hab, &qmsg.ptl);92 qmsg.time = WinQueryMsgTime(teb->o.odin.hab); 93 WinQueryMsgPos(teb->o.odin.hab, &qmsg.ptl); 94 94 qmsg.reserved = 0; 95 95 96 if(OS2ToWinMsgTranslate((PVOID)t hdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)96 if(OS2ToWinMsgTranslate((PVOID)teb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE) 97 97 {//message was not translated 98 98 memset(&winMsg, 0, sizeof(MSG)); … … 101 101 } 102 102 else { 103 pWinMsg = &t hdb->msg;104 t hdb->msgstate++;103 pWinMsg = &teb->o.odin.msg; 104 teb->o.odin.msgstate++; 105 105 } 106 106 … … 357 357 //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now 358 358 swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW; 359 WinSetMultWindowPos(t hdb->hab, &swpClient, 1);359 WinSetMultWindowPos(teb->o.odin.hab, &swpClient, 1); 360 360 361 361 //update child positions: rectWindow is in window coordinates -
trunk/src/user32/pmwindow.cpp
r4599 r4658 1 /* $Id: pmwindow.cpp,v 1.10 7 2000-11-15 20:30:46sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.108 2000-11-21 11:36:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 144 144 OSLIBPOINT point, ClientPoint; 145 145 Win32BaseWindow *win32wnd; 146 T HDB *thdb;146 TEB *teb; 147 147 APIRET rc = 0; 148 148 MSG winMsg, *pWinMsg; … … 151 151 SetWin32TIB(); 152 152 153 t hdb = GetThreadTHDB();153 teb = GetThreadTEB(); 154 154 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 155 155 156 if(!t hdb || (msg != WM_CREATE && win32wnd == NULL)) {156 if(!teb || (msg != WM_CREATE && win32wnd == NULL)) { 157 157 dprintf(("Invalid win32wnd pointer for window %x msg %x", hwnd, msg)); 158 158 goto RunDefWndProc; 159 159 } 160 160 161 if((t hdb->msgstate & 1) == 0)161 if((teb->o.odin.msgstate & 1) == 0) 162 162 {//message that was sent directly to our window proc handler; translate it here 163 163 QMSG qmsg; … … 167 167 qmsg.mp1 = mp1; 168 168 qmsg.mp2 = mp2; 169 qmsg.time = WinQueryMsgTime(t hdb->hab);170 WinQueryMsgPos(t hdb->hab, &qmsg.ptl);169 qmsg.time = WinQueryMsgTime(teb->o.odin.hab); 170 WinQueryMsgPos(teb->o.odin.hab, &qmsg.ptl); 171 171 qmsg.reserved = 0; 172 172 173 if(OS2ToWinMsgTranslate((PVOID)t hdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE)173 if(OS2ToWinMsgTranslate((PVOID)teb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE) 174 174 {//message was not translated 175 175 memset(&winMsg, 0, sizeof(MSG)); … … 178 178 } 179 179 else { 180 pWinMsg = &t hdb->msg;181 t hdb->msgstate++;180 pWinMsg = &teb->o.odin.msg; 181 teb->o.odin.msgstate++; 182 182 } 183 183 … … 197 197 case WM_CREATE: 198 198 { 199 if(t hdb->newWindow == 0)199 if(teb->o.odin.newWindow == 0) 200 200 goto createfail; 201 201 202 202 //Processing is done in after WinCreateWindow returns 203 203 dprintf(("OS2: WM_CREATE %x", hwnd)); 204 win32wnd = (Win32BaseWindow *)t hdb->newWindow;205 t hdb->newWindow = 0;204 win32wnd = (Win32BaseWindow *)teb->o.odin.newWindow; 205 teb->o.odin.newWindow = 0; 206 206 if(win32wnd->MsgCreate(hwnd) == FALSE) 207 207 { … … 794 794 case WM_RENDERFMT: 795 795 case WM_RENDERALLFMTS: 796 case WM_DESTROYCLIPBOARD: 796 797 win32wnd->DispatchMsgA(pWinMsg); 797 798 break; -
trunk/src/user32/win32wbase.cpp
r4628 r4658 1 /* $Id: win32wbase.cpp,v 1.22 3 2000-11-19 11:52:40sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.224 2000-11-21 11:36:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 496 496 497 497 //Store our window object pointer in thread local memory, so PMWINDOW.CPP can retrieve it 498 T HDB *thdb = GetThreadTHDB();499 500 if(t hdb == NULL) {501 dprintf(("Window creation failed - t hdb == NULL")); //this is VERY bad498 TEB *teb = GetThreadTEB(); 499 500 if(teb == NULL) { 501 dprintf(("Window creation failed - teb == NULL")); //this is VERY bad 502 502 ExitProcess(666); 503 503 return FALSE; 504 504 } 505 505 506 t hdb->newWindow = (ULONG)this;506 teb->o.odin.newWindow = (ULONG)this; 507 507 508 508 DWORD dwOSWinStyle;
Note:
See TracChangeset
for help on using the changeset viewer.