Changeset 2312
- Timestamp:
- Jan 3, 2000, 10:37:17 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/user32/new/oslibmsg.cpp ¶
r2290 r2312 1 /* $Id: oslibmsg.cpp,v 1. 6 2000-01-01 14:57:18 cbratschiExp $ */1 /* $Id: oslibmsg.cpp,v 1.7 2000-01-03 21:37:17 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 178 178 thdb->msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg 179 179 memcpy(&thdb->msg, msg, sizeof(MSG)); 180 } 181 return (LONG)WinDispatchMsg(thdb->hab, &os2msg); 180 return (LONG)WinDispatchMsg(thdb->hab, &os2msg); 181 } 182 //SvL: TODO; What to do if messages posted by PostThreadMessage are 183 // dispatched? Wine doesn't appear to do this. 184 // If we call WinDispatchMsg, every window created by the thread 185 // receives this message. Does this also happen in NT? 186 return 0; 182 187 } 183 188 else {//is this allowed? … … 193 198 BOOL rc, eaten; 194 199 THDB *thdb; 200 QMSG os2msg; 195 201 196 202 thdb = GetThreadTHDB(); … … 223 229 } 224 230 while(rc == FALSE); 231 232 return rc; 225 233 } 226 234 else … … 228 236 do { 229 237 eaten = FALSE; 230 rc = WinGetMsg(thdb->hab, MsgThreadPtr, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE), 0);231 if ( MsgThreadPtr->msg == WM_TIMER)232 eaten = TIMER_HandleTimer (MsgThreadPtr);238 rc = WinGetMsg(thdb->hab, &os2msg, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE), 0); 239 if (os2msg.msg == WM_TIMER) 240 eaten = TIMER_HandleTimer(&os2msg); 233 241 } while (eaten); 234 242 } 235 OS2ToWinMsgTranslate((PVOID)thdb, MsgThreadPtr, pMsg, isUnicode, MSG_REMOVE); 243 if(rc) { 244 OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE); 245 memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG)); 246 } 236 247 return rc; 237 248 } … … 393 404 } 394 405 //****************************************************************************** 406 BOOL _System _O32_PostThreadMessage( DWORD, UINT, WPARAM, LPARAM ); 407 408 inline BOOL O32_PostThreadMessage(DWORD a, UINT b, WPARAM c, LPARAM d) 409 { 410 BOOL yyrc; 411 USHORT sel = RestoreOS2FS(); 412 413 yyrc = _O32_PostThreadMessage(a, b, c, d); 414 SetFS(sel); 415 416 return yyrc; 417 } 395 418 //****************************************************************************** 396 419 BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode) 397 420 { 398 THDB *thdb = GetTHDBFromThreadId(threadid);421 // THDB *thdb = GetTHDBFromThreadId(threadid); 399 422 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 400 423 401 if(thdb == NULL) {402 dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));403 return FALSE;404 }424 // if(thdb == NULL) { 425 // dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid)); 426 // return FALSE; 427 // } 405 428 dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam)); 406 429 packet->Msg = msg; 407 430 packet->wParam = wParam; 408 431 packet->lParam = lParam; 409 return WinPostQueueMsg(thdb->hmq, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);410 } 411 //****************************************************************************** 412 //****************************************************************************** 413 432 return _O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet); 433 } 434 //****************************************************************************** 435 //****************************************************************************** 436 -
TabularUnified trunk/src/user32/new/win32wbase.h ¶
r2294 r2312 1 /* $Id: win32wbase.h,v 1.1 5 2000-01-02 20:20:03sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.16 2000-01-03 21:37:17 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 39 39 } CUSTOMWNDDATA; 40 40 41 #define WIN32APP_USERMSGBASE 0x1000 42 #define WIN32APP_POSTMSG 0x1000 41 //PostThreadMessage is done through Open32; which means the message id will be translated 42 //(0xc00 added) 43 #define OPEN32_MSGDIFF 0xC00 44 #define WIN32APP_POSTMSG (0x1000+OPEN32_MSGDIFF) 45 43 46 #define WIN32MSG_MAGICA 0x12345678 44 47 #define WIN32MSG_MAGICW 0x12345679 -
TabularUnified trunk/src/user32/oslibmsg.cpp ¶
r2257 r2312 1 /* $Id: oslibmsg.cpp,v 1. 19 1999-12-29 22:54:00 cbratschiExp $ */1 /* $Id: oslibmsg.cpp,v 1.20 2000-01-03 21:37:16 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 178 178 thdb->msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg 179 179 memcpy(&thdb->msg, msg, sizeof(MSG)); 180 } 181 return (LONG)WinDispatchMsg(thdb->hab, &os2msg); 180 return (LONG)WinDispatchMsg(thdb->hab, &os2msg); 181 } 182 //SvL: TODO; What to do if messages posted by PostThreadMessage are 183 // dispatched? Wine doesn't appear to do this. 184 // If we call WinDispatchMsg, every window created by the thread 185 // receives this message. Does this also happen in NT? 186 return 0; 182 187 } 183 188 else {//is this allowed? … … 193 198 BOOL rc, eaten; 194 199 THDB *thdb; 200 QMSG os2msg; 195 201 196 202 thdb = GetThreadTHDB(); … … 223 229 } 224 230 while(rc == FALSE); 231 232 return rc; 225 233 } 226 234 else … … 228 236 do { 229 237 eaten = FALSE; 230 rc = WinGetMsg(thdb->hab, MsgThreadPtr, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE), 0);231 if ( MsgThreadPtr->msg == WM_TIMER)232 eaten = TIMER_HandleTimer (MsgThreadPtr);238 rc = WinGetMsg(thdb->hab, &os2msg, TranslateWinMsg(uMsgFilterMin, TRUE), TranslateWinMsg(uMsgFilterMax, FALSE), 0); 239 if (os2msg.msg == WM_TIMER) 240 eaten = TIMER_HandleTimer(&os2msg); 233 241 } while (eaten); 234 242 } 235 OS2ToWinMsgTranslate((PVOID)thdb, MsgThreadPtr, pMsg, isUnicode, MSG_REMOVE); 243 if(rc) { 244 OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE); 245 memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG)); 246 } 236 247 return rc; 237 248 } … … 393 404 } 394 405 //****************************************************************************** 406 BOOL _System _O32_PostThreadMessage( DWORD, UINT, WPARAM, LPARAM ); 407 408 inline BOOL O32_PostThreadMessage(DWORD a, UINT b, WPARAM c, LPARAM d) 409 { 410 BOOL yyrc; 411 USHORT sel = RestoreOS2FS(); 412 413 yyrc = _O32_PostThreadMessage(a, b, c, d); 414 SetFS(sel); 415 416 return yyrc; 417 } 395 418 //****************************************************************************** 396 419 BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode) 397 420 { 398 THDB *thdb = GetTHDBFromThreadId(threadid);421 // THDB *thdb = GetTHDBFromThreadId(threadid); 399 422 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 400 423 401 if(thdb == NULL) {402 dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));403 return FALSE;404 }424 // if(thdb == NULL) { 425 // dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid)); 426 // return FALSE; 427 // } 405 428 dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam)); 406 429 packet->Msg = msg; 407 430 packet->wParam = wParam; 408 431 packet->lParam = lParam; 409 return WinPostQueueMsg(thdb->hmq, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);410 } 411 //****************************************************************************** 412 //****************************************************************************** 413 432 return _O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet); 433 } 434 //****************************************************************************** 435 //****************************************************************************** 436 -
TabularUnified trunk/src/user32/oslibmsgtranslate.cpp ¶
r2257 r2312 1 /* $Id: oslibmsgtranslate.cpp,v 1. 6 1999-12-29 22:54:01 cbratschiExp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.7 2000-01-03 21:37:16 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 132 132 winMsg->wParam = packet->wParam; 133 133 winMsg->lParam = packet->lParam; 134 if(fMsgRemoved == MSG_REMOVE) free(packet); //free the shared memory here 134 if(fMsgRemoved == MSG_REMOVE) 135 free(packet); //free the shared memory here 135 136 break; 136 137 } -
TabularUnified trunk/src/user32/win32wbase.h ¶
r2295 r2312 1 /* $Id: win32wbase.h,v 1.6 5 2000-01-02 20:30:22sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.66 2000-01-03 21:37:17 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 39 39 } CUSTOMWNDDATA; 40 40 41 #define WIN32APP_USERMSGBASE 0x1000 42 #define WIN32APP_POSTMSG 0x1000 41 //PostThreadMessage is done through Open32; which means the message id will be translated 42 //(0xc00 added) 43 #define OPEN32_MSGDIFF 0xC00 44 #define WIN32APP_POSTMSG (0x1000+OPEN32_MSGDIFF) 45 43 46 #define WIN32MSG_MAGICA 0x12345678 44 47 #define WIN32MSG_MAGICW 0x12345679
Note:
See TracChangeset
for help on using the changeset viewer.