Changeset 3525 for trunk/src/user32/oslibmsg.cpp
- Timestamp:
- May 12, 2000, 8:09:42 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsg.cpp
r3373 r3525 1 /* $Id: oslibmsg.cpp,v 1.3 2 2000-04-13 18:50:44sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.33 2000-05-12 18:09:40 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 99 99 #define MAX_MSGTRANSTAB (sizeof(MsgTransTab)/sizeof(MsgTransTab[0])) 100 100 101 QMSG *MsgThreadPtr = 0;102 103 101 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 104 102 105 //******************************************************************************106 //******************************************************************************107 BOOL OSLibInitMsgQueue()108 {109 if(DosAllocThreadLocalMemory(sizeof(QMSG)/sizeof(ULONG), (PULONG *)&MsgThreadPtr) != 0)110 {111 dprintf(("OSLibInitMsgQueue: local thread memory alloc failed!!"));112 DebugInt3();113 return FALSE;114 }115 return TRUE;116 }117 103 //****************************************************************************** 118 104 //****************************************************************************** … … 176 162 // WinToOS2MsgTranslate(msg, &qmsg, isUnicode); 177 163 178 if(msg->time == MsgThreadPtr->time || msg->hwnd == 0) { 179 memcpy(&os2msg, MsgThreadPtr, sizeof(QMSG)); 180 MsgThreadPtr->time = -1; 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; 181 168 if(msg->hwnd) { 182 169 thdb->nrOfMsgs = 1; … … 185 172 } 186 173 if(os2msg.hwnd || os2msg.msg == WM_QUIT) { 187 memset(MsgThreadPtr, 0, sizeof(*MsgThreadPtr)); 174 memset(&thdb->os2msg, 0, sizeof(thdb->os2msg)); 175 memset(&thdb->winmsg, 0, sizeof(thdb->winmsg)); 188 176 return (LONG)WinDispatchMsg(thdb->hab, &os2msg); 189 177 } … … 235 223 thdb->fTranslated = FALSE; 236 224 memcpy(pMsg, &thdb->msgWCHAR, sizeof(MSG)); 237 MsgThreadPtr->msg = 0;238 MsgThreadPtr->hwnd = 0;225 thdb->os2msg.msg = 0; 226 thdb->os2msg.hwnd = 0; 239 227 return (pMsg->message != WINWM_QUIT); 240 228 } … … 261 249 262 250 OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE); 263 memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG)); 251 memcpy(&thdb->os2msg, &os2msg, sizeof(QMSG)); 252 memcpy(&thdb->winmsg, pMsg, sizeof(MSG)); 264 253 265 254 if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN) … … 317 306 if(fRemove & PM_REMOVE_W) { 318 307 thdb->fTranslated = FALSE; 319 MsgThreadPtr->msg = 0;320 MsgThreadPtr->hwnd = 0;308 thdb->os2msg.msg = 0; 309 thdb->os2msg.hwnd = 0; 321 310 } 322 311 memcpy(pMsg, &thdb->msgWCHAR, sizeof(MSG)); … … 343 332 //TODO: This is not safe! There's no guarantee this message will be dispatched and it might overwrite a previous message 344 333 if(fRemove & PM_REMOVE_W) { 345 memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG)); 334 memcpy(&thdb->os2msg, &os2msg, sizeof(QMSG)); 335 memcpy(&thdb->winmsg, pMsg, sizeof(MSG)); 346 336 } 347 337
Note:
See TracChangeset
for help on using the changeset viewer.