We will need this to discard a specific internal message type without processing any of the other messages.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- server/queue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 84ee0f9a4eac..fcb15d91daa1 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2386,8 +2386,8 @@ DECL_HANDLER(post_quit_message) /* get a message from the current queue */ DECL_HANDLER(get_message) { + struct message *msg; struct timer *timer; - struct list *ptr; struct msg_queue *queue = get_current_queue(); user_handle_t get_win = get_user_full_handle( req->get_win ); unsigned int filter = req->flags >> 16; @@ -2405,9 +2405,12 @@ DECL_HANDLER(get_message) if (!filter) filter = QS_ALLINPUT;
/* first check for sent messages */ - if ((ptr = list_head( &queue->msg_list[SEND_MESSAGE] ))) + LIST_FOR_EACH_ENTRY( msg, &queue->msg_list[SEND_MESSAGE], struct message, entry ) { - struct message *msg = LIST_ENTRY( ptr, struct message, entry ); + /* skip filtered internal messages */ + if ((req->get_first & 0x80000000) && (req->get_last & 0x80000000) && + (req->get_first > msg->msg || req->get_last < msg->msg)) + continue; receive_message( queue, msg, reply ); return; }