Rebase against 19ad5bd598d603617341cbb2beec90bd69fa6349.

This commit is contained in:
Alistair Leslie-Hughes 2023-12-14 10:05:14 +11:00
parent 06d1eb5825
commit 6a68d558cd
2 changed files with 23 additions and 23 deletions

View File

@ -1,4 +1,4 @@
From 64bdd8316ca10dd8bd474abb1fe7377dfd678762 Mon Sep 17 00:00:00 2001
From 7685969c358fbfb68d623d6eb4fc80231f07b604 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 15 Mar 2015 01:05:48 +0100
Subject: [PATCH] server: Fix handling of GetMessage after previous PeekMessage
@ -15,10 +15,10 @@ Changes in v3:
2 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 8b89d92cbf1..e7f133899ed 100644
index 0059afcbac7..cf01e156458 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -14012,13 +14012,10 @@ static void test_PeekMessage3(void)
@@ -14113,13 +14113,10 @@ static void test_PeekMessage3(void)
ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
PostMessageA(hwnd, WM_USER, 0, 0);
ret = PeekMessageA(&msg, hwnd, 0, 0, PM_NOREMOVE);
@ -32,7 +32,7 @@ index 8b89d92cbf1..e7f133899ed 100644
ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
@@ -14028,10 +14025,8 @@ static void test_PeekMessage3(void)
@@ -14129,10 +14126,8 @@ static void test_PeekMessage3(void)
ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
PostMessageA(hwnd, WM_USER, 0, 0);
ret = PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE);
@ -43,7 +43,7 @@ index 8b89d92cbf1..e7f133899ed 100644
ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
@@ -14043,10 +14038,11 @@ static void test_PeekMessage3(void)
@@ -14144,10 +14139,11 @@ static void test_PeekMessage3(void)
ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
PostMessageA(hwnd, WM_USER, 0, 0);
ret = GetMessageA(&msg, hwnd, 0, 0);
@ -57,7 +57,7 @@ index 8b89d92cbf1..e7f133899ed 100644
ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
@@ -14074,14 +14070,32 @@ static void test_PeekMessage3(void)
@@ -14175,14 +14171,32 @@ static void test_PeekMessage3(void)
ret = GetMessageA(&msg, hwnd, 0, 0);
ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
ret = GetMessageA(&msg, hwnd, 0, 0);
@ -93,7 +93,7 @@ index 8b89d92cbf1..e7f133899ed 100644
* because both messages are in the same queue. */
diff --git a/server/queue.c b/server/queue.c
index fcc946ff0cb..348fdac3214 100644
index 9007438e082..1d7a31a318a 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -142,6 +142,7 @@ struct msg_queue
@ -112,7 +112,7 @@ index fcc946ff0cb..348fdac3214 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -634,13 +636,21 @@ static inline struct msg_queue *get_current_queue(void)
@@ -643,13 +645,21 @@ static inline struct msg_queue *get_current_queue(void)
}
/* get a (pseudo-)unique id to tag hardware messages */
@ -135,7 +135,7 @@ index fcc946ff0cb..348fdac3214 100644
/* try to merge a WM_MOUSEMOVE message with the last in the list; return 1 if successful */
static int merge_mousemove( struct thread_input *input, const struct message *msg )
{
@@ -951,7 +961,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
@@ -960,7 +970,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
}
/* retrieve a posted message */
@ -144,7 +144,7 @@ index fcc946ff0cb..348fdac3214 100644
unsigned int first, unsigned int last, unsigned int flags,
struct get_message_reply *reply )
{
@@ -962,6 +972,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win,
@@ -971,6 +981,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win,
{
if (!match_window( win, msg->win )) continue;
if (!check_msg_filter( msg->msg, first, last )) continue;
@ -152,7 +152,7 @@ index fcc946ff0cb..348fdac3214 100644
goto found; /* found one */
}
return 0;
@@ -1576,6 +1587,7 @@ found:
@@ -1585,6 +1596,7 @@ found:
msg->msg = WM_HOTKEY;
msg->wparam = hotkey->id;
msg->lparam = ((hotkey->vkey & 0xffff) << 16) | modifiers;
@ -160,7 +160,7 @@ index fcc946ff0cb..348fdac3214 100644
free( msg->data );
msg->data = NULL;
@@ -2267,7 +2279,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
@@ -2276,7 +2288,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
}
/* now we can return it */
@ -169,7 +169,7 @@ index fcc946ff0cb..348fdac3214 100644
reply->type = MSG_HARDWARE;
reply->win = win;
reply->msg = msg_code;
@@ -2373,6 +2385,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa
@@ -2382,6 +2394,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa
msg->result = NULL;
msg->data = NULL;
msg->data_size = 0;
@ -177,7 +177,7 @@ index fcc946ff0cb..348fdac3214 100644
get_message_defaults( thread->queue, &msg->x, &msg->y, &msg->time );
@@ -2617,6 +2630,7 @@ DECL_HANDLER(send_message)
@@ -2626,6 +2639,7 @@ DECL_HANDLER(send_message)
set_queue_bits( recv_queue, QS_SENDMESSAGE );
break;
case MSG_POSTED:
@ -185,7 +185,7 @@ index fcc946ff0cb..348fdac3214 100644
list_add_tail( &recv_queue->msg_list[POST_MESSAGE], &msg->entry );
set_queue_bits( recv_queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE );
if (msg->msg == WM_HOTKEY)
@@ -2735,12 +2749,12 @@ DECL_HANDLER(get_message)
@@ -2744,12 +2758,12 @@ DECL_HANDLER(get_message)
/* then check for posted messages */
if ((filter & QS_POSTMESSAGE) &&
@ -200,16 +200,16 @@ index fcc946ff0cb..348fdac3214 100644
return;
/* only check for quit messages if not posted messages pending */
@@ -2751,7 +2765,7 @@ DECL_HANDLER(get_message)
@@ -2760,7 +2774,7 @@ DECL_HANDLER(get_message)
if ((filter & QS_INPUT) &&
filter_contains_hw_range( req->get_first, req->get_last ) &&
get_hardware_message( current, req->hw_id, get_win, req->get_first, req->get_last, req->flags, reply ))
- return;
+ goto found_msg;
/* now check for WM_PAINT */
if ((filter & QS_PAINT) &&
@@ -2764,7 +2778,7 @@ DECL_HANDLER(get_message)
/* check for any internal driver message */
if (get_hardware_message( current, req->hw_id, get_win, WM_WINE_FIRST_DRIVER_MSG,
@@ -2778,7 +2792,7 @@ DECL_HANDLER(get_message)
reply->wparam = 0;
reply->lparam = 0;
get_message_defaults( queue, &reply->x, &reply->y, &reply->time );
@ -218,7 +218,7 @@ index fcc946ff0cb..348fdac3214 100644
}
/* now check for timer */
@@ -2780,13 +2794,30 @@ DECL_HANDLER(get_message)
@@ -2794,13 +2808,30 @@ DECL_HANDLER(get_message)
get_message_defaults( queue, &reply->x, &reply->y, &reply->time );
if (!(req->flags & PM_NOYIELD) && current->process->idle_event)
set_event( current->process->idle_event );
@ -250,7 +250,7 @@ index fcc946ff0cb..348fdac3214 100644
}
@@ -2804,7 +2835,10 @@ DECL_HANDLER(reply_message)
@@ -2818,7 +2849,10 @@ DECL_HANDLER(reply_message)
DECL_HANDLER(accept_hardware_message)
{
if (current->queue)
@ -262,5 +262,5 @@ index fcc946ff0cb..348fdac3214 100644
set_error( STATUS_ACCESS_DENIED );
}
--
2.40.1
2.43.0

View File

@ -1 +1 @@
93f7ef86701f0b5f0828c8e0c4581b00873a7676
19ad5bd598d603617341cbb2beec90bd69fa6349