Commit 2faf2cf9 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Perform 16/32A/32W message mapping for posted messages.

parent 7b7e2d43
...@@ -2609,7 +2609,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, ...@@ -2609,7 +2609,7 @@ static INT MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
/* we have to keep the message in the queue until it's /* we have to keep the message in the queue until it's
* clear that menu loop is not over yet. */ * clear that menu loop is not over yet. */
if (!MSG_InternalGetMessage( &msg, msg.hwnd, mt.hOwnerWnd, if (!MSG_InternalGetMessage( QMSG_WIN32A, &msg, msg.hwnd, mt.hOwnerWnd,
MSGF_MENU, PM_NOREMOVE, !enterIdleSent, &enterIdleSent )) break; MSGF_MENU, PM_NOREMOVE, !enterIdleSent, &enterIdleSent )) break;
TranslateMessage( &msg ); TranslateMessage( &msg );
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */ extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
/* message.c */ /* message.c */
extern BOOL MSG_InternalGetMessage( MSG *msg, HWND hwnd, extern BOOL MSG_InternalGetMessage( int type, MSG *msg, HWND hwnd,
HWND hwndOwner, WPARAM code, HWND hwndOwner, WPARAM code,
WORD flags, BOOL sendIdle, BOOL* idleSent ); WORD flags, BOOL sendIdle, BOOL* idleSent );
/* timer.c */ /* timer.c */
extern BOOL TIMER_Init( void ); extern BOOL TIMER_Init( void );
......
...@@ -15,13 +15,19 @@ ...@@ -15,13 +15,19 @@
/* Message as stored in the queue (contains the extraInfo field) */ /* Message as stored in the queue (contains the extraInfo field) */
typedef struct tagQMSG typedef struct tagQMSG
{ {
int type;
MSG msg; MSG msg;
DWORD extraInfo; /* Only in 3.1 */ DWORD extraInfo; /* Only in 3.1 */
struct tagQMSG *nextMsg; struct tagQMSG *nextMsg;
struct tagQMSG *prevMsg; struct tagQMSG *prevMsg;
} QMSG; } QMSG;
#define QMSG_WIN16 0
#define QMSG_WIN32A 1
#define QMSG_WIN32W 2
#define QMSG_HARDWARE 3
typedef struct tagSMSG typedef struct tagSMSG
{ {
...@@ -160,7 +166,7 @@ extern void QUEUE_DecTimerCount( HQUEUE16 hQueue ); ...@@ -160,7 +166,7 @@ extern void QUEUE_DecTimerCount( HQUEUE16 hQueue );
extern BOOL QUEUE_CreateSysMsgQueue( int size ); extern BOOL QUEUE_CreateSysMsgQueue( int size );
extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue ); extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue ); extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
extern BOOL QUEUE_AddMsg( HQUEUE16 hQueue, MSG * msg, DWORD extraInfo ); extern BOOL QUEUE_AddMsg( HQUEUE16 hQueue, int type, MSG * msg, DWORD extraInfo );
extern QMSG* QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd, extern QMSG* QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd,
int first, int last ); int first, int last );
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg ); extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, QMSG *qmsg );
......
...@@ -945,7 +945,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) ...@@ -945,7 +945,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
{ {
EnableWindow( owner, FALSE ); EnableWindow( owner, FALSE );
ShowWindow( hwnd, SW_SHOW ); ShowWindow( hwnd, SW_SHOW );
while (MSG_InternalGetMessage(&msg, hwnd, owner, MSGF_DIALOGBOX, while (MSG_InternalGetMessage(QMSG_WIN32A, &msg, hwnd, owner, MSGF_DIALOGBOX,
PM_REMOVE, !(wndPtr->dwStyle & DS_NOIDLEMSG), NULL )) PM_REMOVE, !(wndPtr->dwStyle & DS_NOIDLEMSG), NULL ))
{ {
if (!IsDialogMessageA( hwnd, &msg)) if (!IsDialogMessageA( hwnd, &msg))
......
...@@ -2045,7 +2045,7 @@ static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam, ...@@ -2045,7 +2045,7 @@ static LONG NC_StartSizeMove( WND* wndPtr, WPARAM16 wParam,
{ {
while(!hittest) while(!hittest)
{ {
MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL ); MSG_InternalGetMessage( QMSG_WIN32A, &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL );
switch(msg.message) switch(msg.message)
{ {
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
...@@ -2206,7 +2206,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam ) ...@@ -2206,7 +2206,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
{ {
int dx = 0, dy = 0; int dx = 0, dy = 0;
MSG_InternalGetMessage( &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL ); MSG_InternalGetMessage( QMSG_WIN32A, &msg, 0, 0, MSGF_SIZE, PM_REMOVE, FALSE, NULL );
/* Exit on button-up, Return, or Esc */ /* Exit on button-up, Return, or Esc */
if ((msg.message == WM_LBUTTONUP) || if ((msg.message == WM_LBUTTONUP) ||
...@@ -2395,7 +2395,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) ...@@ -2395,7 +2395,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam )
do do
{ {
BOOL oldstate = pressed; BOOL oldstate = pressed;
MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL ); MSG_InternalGetMessage( QMSG_WIN32A, &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
...@@ -2445,7 +2445,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) ...@@ -2445,7 +2445,7 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
do do
{ {
BOOL oldstate = pressed; BOOL oldstate = pressed;
MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL ); MSG_InternalGetMessage( QMSG_WIN32A, &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
...@@ -2501,7 +2501,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam) ...@@ -2501,7 +2501,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
do do
{ {
BOOL oldstate = pressed; BOOL oldstate = pressed;
MSG_InternalGetMessage( &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL ); MSG_InternalGetMessage( QMSG_WIN32A, &msg, 0, 0, 0, PM_REMOVE, FALSE, NULL );
CONV_POINT32TO16( &msg.pt, &pt16 ); CONV_POINT32TO16( &msg.pt, &pt16 );
pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam); pressed = (NC_HandleNCHitTest( hwnd, pt16 ) == wParam);
......
...@@ -973,7 +973,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue ) ...@@ -973,7 +973,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
* *
* Add a message to the queue. Return FALSE if queue is full. * Add a message to the queue. Return FALSE if queue is full.
*/ */
BOOL QUEUE_AddMsg( HQUEUE16 hQueue, MSG *msg, DWORD extraInfo ) BOOL QUEUE_AddMsg( HQUEUE16 hQueue, int type, MSG *msg, DWORD extraInfo )
{ {
MESSAGEQUEUE *msgQueue; MESSAGEQUEUE *msgQueue;
QMSG *qmsg; QMSG *qmsg;
...@@ -991,6 +991,7 @@ BOOL QUEUE_AddMsg( HQUEUE16 hQueue, MSG *msg, DWORD extraInfo ) ...@@ -991,6 +991,7 @@ BOOL QUEUE_AddMsg( HQUEUE16 hQueue, MSG *msg, DWORD extraInfo )
EnterCriticalSection( &msgQueue->cSection ); EnterCriticalSection( &msgQueue->cSection );
/* Store message */ /* Store message */
qmsg->type = type;
qmsg->msg = *msg; qmsg->msg = *msg;
qmsg->extraInfo = extraInfo; qmsg->extraInfo = extraInfo;
...@@ -1228,6 +1229,7 @@ void hardware_event( UINT message, WPARAM wParam, LPARAM lParam, ...@@ -1228,6 +1229,7 @@ void hardware_event( UINT message, WPARAM wParam, LPARAM lParam,
msg->pt.x = xPos; msg->pt.x = xPos;
msg->pt.y = yPos; msg->pt.y = yPos;
qmsg->extraInfo = extraInfo; qmsg->extraInfo = extraInfo;
qmsg->type = QMSG_HARDWARE;
LeaveCriticalSection( &sysMsgQueue->cSection ); LeaveCriticalSection( &sysMsgQueue->cSection );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment