From 0d4b9f2f626073c8c9de44795e541b9518dc5a7b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 2 Jul 2024 11:15:09 +1000 Subject: [PATCH] Rebase against 17f052c36a414a05fcb6a6e67bd3aac824fbed3e. --- ...l-Implement-NtWaitForMultipleObjects.patch | 22 ++++++----- ...entfd-file-descriptors-for-message-q.patch | 38 +++++++++--------- ...server-ntdll-Implement-message-waits.patch | 26 +++++++------ ...unmodified-WRITECOPY-pages-as-shared.patch | 24 ++++++------ ...ing-of-GetMessage-after-previous-Pee.patch | 39 ++++++++++--------- staging/upstream-commit | 2 +- 6 files changed, 79 insertions(+), 72 deletions(-) diff --git a/patches/eventfd_synchronization/0006-ntdll-Implement-NtWaitForMultipleObjects.patch b/patches/eventfd_synchronization/0006-ntdll-Implement-NtWaitForMultipleObjects.patch index f7597b4b..40ff1a19 100644 --- a/patches/eventfd_synchronization/0006-ntdll-Implement-NtWaitForMultipleObjects.patch +++ b/patches/eventfd_synchronization/0006-ntdll-Implement-NtWaitForMultipleObjects.patch @@ -1,28 +1,30 @@ -From cdced5d4d89a932fa456191551899e1919a1881e Mon Sep 17 00:00:00 2001 +From f0ff0cdc5472deafb8c75f3d0d6456ddb4164878 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 12:34:42 -0500 Subject: [PATCH] ntdll: Implement NtWaitForMultipleObjects(). --- - dlls/ntdll/unix/esync.c | 170 ++++++++++++++++++++++++++++++++++++++++ + dlls/ntdll/unix/esync.c | 172 ++++++++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/esync.h | 3 + dlls/ntdll/unix/sync.c | 7 ++ - 3 files changed, 180 insertions(+) + 3 files changed, 182 insertions(+) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c -index e031e9cb94f..75ceb95bc66 100644 +index e031e9cb94f..f383221194c 100644 --- a/dlls/ntdll/unix/esync.c +++ b/dlls/ntdll/unix/esync.c -@@ -22,6 +22,8 @@ +@@ -22,6 +22,10 @@ #pragma makedep unix #endif ++#ifndef _GNU_SOURCE +#define _GNU_SOURCE ++#endif + #include "config.h" #include -@@ -34,6 +36,12 @@ +@@ -34,6 +38,12 @@ #ifdef HAVE_SYS_STAT_H # include #endif @@ -35,7 +37,7 @@ index e031e9cb94f..75ceb95bc66 100644 #include #include -@@ -286,6 +294,168 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) +@@ -286,6 +296,168 @@ NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev ) return STATUS_SUCCESS; } @@ -219,10 +221,10 @@ index c63491dcaad..92b609ebd27 100644 /* We have to synchronize on the fd cache mutex so that our calls to receive_fd * don't race with theirs. It looks weird, I know. diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index c85f985b4f3..79141999e33 100644 +index 76da038649f..1c60cd11f77 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -1479,6 +1479,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO +@@ -1524,6 +1524,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1; @@ -237,5 +239,5 @@ index c85f985b4f3..79141999e33 100644 select_op.wait.op = wait_any ? SELECT_WAIT : SELECT_WAIT_ALL; for (i = 0; i < count; i++) select_op.wait.handles[i] = wine_server_obj_handle( handles[i] ); -- -2.42.0 +2.43.0 diff --git a/patches/eventfd_synchronization/0020-server-Create-eventfd-file-descriptors-for-message-q.patch b/patches/eventfd_synchronization/0020-server-Create-eventfd-file-descriptors-for-message-q.patch index 8a2e55ef..c14ede99 100644 --- a/patches/eventfd_synchronization/0020-server-Create-eventfd-file-descriptors-for-message-q.patch +++ b/patches/eventfd_synchronization/0020-server-Create-eventfd-file-descriptors-for-message-q.patch @@ -1,4 +1,4 @@ -From f1fcc584ff2bb975656b9f2f111d3e09b36293d0 Mon Sep 17 00:00:00 2001 +From 27e2bc1b0d098abce9168ea46589024054817e25 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:01:56 -0500 Subject: [PATCH] server: Create eventfd file descriptors for message queues. @@ -8,7 +8,7 @@ Subject: [PATCH] server: Create eventfd file descriptors for message queues. 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/server/queue.c b/server/queue.c -index 4d3f43b8d52..74a59b2ee84 100644 +index ee575724e4e..60f0c043257 100644 --- a/server/queue.c +++ b/server/queue.c @@ -44,6 +44,7 @@ @@ -19,7 +19,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) -@@ -148,6 +149,7 @@ struct msg_queue +@@ -144,6 +145,7 @@ struct msg_queue int keystate_lock; /* owns an input keystate lock */ const queue_shm_t *shared; /* queue in session shared memory */ unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */ @@ -27,7 +27,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 }; struct hotkey -@@ -164,6 +166,7 @@ static void msg_queue_dump( struct object *obj, int verbose ); +@@ -160,6 +162,7 @@ static void msg_queue_dump( struct object *obj, int verbose ); static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry ); static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry ); @@ -35,7 +35,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ); static void msg_queue_destroy( struct object *obj ); static void msg_queue_poll_event( struct fd *fd, int event ); -@@ -179,7 +182,7 @@ static const struct object_ops msg_queue_ops = +@@ -175,7 +178,7 @@ static const struct object_ops msg_queue_ops = msg_queue_add_queue, /* add_queue */ msg_queue_remove_queue, /* remove_queue */ msg_queue_signaled, /* signaled */ @@ -44,7 +44,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 msg_queue_satisfied, /* satisfied */ no_signal, /* signal */ no_get_fd, /* get_fd */ -@@ -321,6 +324,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ +@@ -313,6 +316,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->last_get_msg = current_time; queue->keystate_lock = 0; queue->ignore_post_msg = 0; @@ -52,7 +52,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); -@@ -339,6 +343,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ +@@ -335,6 +339,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ } SHARED_WRITE_END; @@ -62,7 +62,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 thread->queue = queue; if ((desktop = get_thread_desktop( thread, 0 ))) -@@ -672,6 +679,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits +@@ -685,6 +692,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits if (queue->keystate_lock) unlock_input_keystate( queue->input ); queue->keystate_lock = 0; } @@ -72,7 +72,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 } /* check if message is matched by the filter */ -@@ -1213,6 +1223,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr +@@ -1227,6 +1237,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr return ret || is_signaled( queue ); } @@ -86,7 +86,7 @@ index 4d3f43b8d52..74a59b2ee84 100644 static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry ) { struct msg_queue *queue = (struct msg_queue *)obj; -@@ -1258,6 +1275,7 @@ static void msg_queue_destroy( struct object *obj ) +@@ -1278,6 +1295,7 @@ static void msg_queue_destroy( struct object *obj ) if (queue->hooks) release_object( queue->hooks ); if (queue->fd) release_object( queue->fd ); if (queue->shared) free_shared_object( queue->shared ); @@ -94,8 +94,8 @@ index 4d3f43b8d52..74a59b2ee84 100644 } static void msg_queue_poll_event( struct fd *fd, int event ) -@@ -2962,6 +2980,9 @@ DECL_HANDLER(set_queue_mask) - if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0; +@@ -3000,6 +3018,9 @@ DECL_HANDLER(set_queue_mask) + } else wake_up( &queue->obj, 0 ); } + @@ -104,19 +104,19 @@ index 4d3f43b8d52..74a59b2ee84 100644 } } -@@ -2975,6 +2996,9 @@ DECL_HANDLER(get_queue_status) - reply->wake_bits = queue->wake_bits; - reply->changed_bits = queue->changed_bits; - queue->changed_bits &= ~req->clear_bits; +@@ -3020,6 +3041,9 @@ DECL_HANDLER(get_queue_status) + shared->changed_bits &= ~req->clear_bits; + } + SHARED_WRITE_END; + + if (do_esync() && !is_signaled( queue )) + esync_clear( queue->esync_fd ); } else reply->wake_bits = reply->changed_bits = 0; } -@@ -3229,6 +3253,10 @@ DECL_HANDLER(get_message) - queue->wake_mask = req->wake_mask; - queue->changed_mask = req->changed_mask; +@@ -3286,6 +3310,10 @@ DECL_HANDLER(get_message) + SHARED_WRITE_END; + set_error( STATUS_PENDING ); /* FIXME */ + + if (do_esync() && !is_signaled( queue )) diff --git a/patches/eventfd_synchronization/0021-server-ntdll-Implement-message-waits.patch b/patches/eventfd_synchronization/0021-server-ntdll-Implement-message-waits.patch index b021cda0..da9693f4 100644 --- a/patches/eventfd_synchronization/0021-server-ntdll-Implement-message-waits.patch +++ b/patches/eventfd_synchronization/0021-server-ntdll-Implement-message-waits.patch @@ -1,4 +1,4 @@ -From 57703c0423cf2b138b93dfaf4bd993d50235e55a Mon Sep 17 00:00:00 2001 +From 7522f4cf4bb29413bce97be5e61ebaefb5276c77 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 6 Jul 2020 16:11:23 -0500 Subject: [PATCH] server, ntdll: Implement message waits. @@ -6,8 +6,8 @@ Subject: [PATCH] server, ntdll: Implement message waits. --- dlls/ntdll/unix/esync.c | 51 +++++++++++++++++++++++++++++++++++++++-- server/protocol.def | 4 ++++ - server/queue.c | 22 ++++++++++++++++++ - 3 files changed, 75 insertions(+), 2 deletions(-) + server/queue.c | 24 +++++++++++++++++++ + 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c index 399930c444b..06d7d8babc6 100644 @@ -105,10 +105,10 @@ index 399930c444b..06d7d8babc6 100644 { struct stat st; diff --git a/server/protocol.def b/server/protocol.def -index d4a7173776f..4a081973ca5 100644 +index 56f2d263100..46cdbbed9b7 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -3964,6 +3964,10 @@ enum esync_type +@@ -3968,6 +3968,10 @@ enum esync_type unsigned int shm_idx; @END @@ -120,10 +120,10 @@ index d4a7173776f..4a081973ca5 100644 @REQ(set_keyboard_repeat) int enable; /* whether to enable auto-repeat */ diff --git a/server/queue.c b/server/queue.c -index 6183c2fa686..260fb753799 100644 +index 60f0c043257..d6b6f2f20aa 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -150,6 +150,7 @@ struct msg_queue +@@ -146,6 +146,7 @@ struct msg_queue const queue_shm_t *shared; /* queue in session shared memory */ unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */ int esync_fd; /* esync file descriptor (signalled on message) */ @@ -131,7 +131,7 @@ index 6183c2fa686..260fb753799 100644 }; struct hotkey -@@ -325,6 +326,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ +@@ -317,6 +318,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->keystate_lock = 0; queue->ignore_post_msg = 0; queue->esync_fd = -1; @@ -139,7 +139,7 @@ index 6183c2fa686..260fb753799 100644 list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); -@@ -1170,6 +1172,10 @@ static int is_queue_hung( struct msg_queue *queue ) +@@ -1183,6 +1185,10 @@ static int is_queue_hung( struct msg_queue *queue ) if (get_wait_queue_thread(entry)->queue == queue) return 0; /* thread is waiting on queue -> not hung */ } @@ -150,18 +150,20 @@ index 6183c2fa686..260fb753799 100644 return 1; } -@@ -4025,6 +4031,21 @@ DECL_HANDLER(update_rawinput_devices) +@@ -4079,6 +4085,23 @@ DECL_HANDLER(update_rawinput_devices) } } +DECL_HANDLER(esync_msgwait) +{ + struct msg_queue *queue = get_current_queue(); ++ const queue_shm_t *queue_shm; + + if (!queue) return; ++ queue_shm = queue->shared; + queue->esync_in_msgwait = req->in_msgwait; + -+ if (current->process->idle_event && !(queue->wake_mask & QS_SMRESULT)) ++ if (current->process->idle_event && !(queue_shm->wake_mask & QS_SMRESULT)) + set_event( current->process->idle_event ); + + /* and start/stop waiting on the driver */ @@ -172,7 +174,7 @@ index 6183c2fa686..260fb753799 100644 DECL_HANDLER(set_keyboard_repeat) { struct desktop *desktop; -@@ -4043,3 +4064,4 @@ DECL_HANDLER(set_keyboard_repeat) +@@ -4097,3 +4120,4 @@ DECL_HANDLER(set_keyboard_repeat) release_object( desktop ); } diff --git a/patches/ntdll-WRITECOPY/0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch b/patches/ntdll-WRITECOPY/0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch index d436f558..2d8508fa 100644 --- a/patches/ntdll-WRITECOPY/0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch +++ b/patches/ntdll-WRITECOPY/0007-ntdll-Report-unmodified-WRITECOPY-pages-as-shared.patch @@ -1,4 +1,4 @@ -From 52baf4b2f68a78a2d0a0ad16fac8e25af70400ff Mon Sep 17 00:00:00 2001 +From b083e23347c3f50112410d1c886eb17c75f34a4e Mon Sep 17 00:00:00 2001 From: Andrew Wesie Date: Fri, 24 Apr 2020 14:55:17 -0500 Subject: [PATCH] ntdll: Report unmodified WRITECOPY pages as shared. @@ -13,10 +13,10 @@ Signed-off-by: Andrew Wesie 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 6c530304442..05d4d517aeb 100644 +index b3d8b2f7a95..568a0cef74c 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -2441,6 +2441,8 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena +@@ -2897,6 +2897,8 @@ static NTSTATUS map_image_into_view( struct file_view *view, const WCHAR *filena ptr + sec->VirtualAddress + file_size, ptr + sec->VirtualAddress + end ); memset( ptr + sec->VirtualAddress + file_size, 0, end - file_size ); @@ -25,15 +25,15 @@ index 6c530304442..05d4d517aeb 100644 } } -@@ -4420,7 +4422,7 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, - } +@@ -5326,7 +5328,7 @@ static void fill_working_set_info( struct fill_working_set_info_data *d, struct + pagemap = d->pm_buffer[page - d->buffer_start]; - p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63); -- p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1); -+ p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_WRITTEN)); - if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid) - p->VirtualAttributes.ShareCount = 1; /* FIXME */ - if (p->VirtualAttributes.Valid) + p->VirtualAttributes.Valid = !(vprot & VPROT_GUARD) && (vprot & 0x0f) && (pagemap >> 63); +- p->VirtualAttributes.Shared = !is_view_valloc( view ) && ((pagemap >> 61) & 1); ++ p->VirtualAttributes.Shared = (!is_view_valloc( view ) && ((pagemap >> 61) & 1)) || ((view->protect & VPROT_WRITECOPY) && !(vprot & VPROT_WRITTEN)); + if (p->VirtualAttributes.Shared && p->VirtualAttributes.Valid) + p->VirtualAttributes.ShareCount = 1; /* FIXME */ + if (p->VirtualAttributes.Valid) -- -2.35.1 +2.43.0 diff --git a/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch b/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch index 5c1dcb05..ed139086 100644 --- a/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch +++ b/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch @@ -1,4 +1,4 @@ -From f53204bf14a0ac962d389467e9e915724639ad03 Mon Sep 17 00:00:00 2001 +From a3f14d043f05ff7cfaf00bc548d02f32dd85cc8f Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 15 Mar 2015 01:05:48 +0100 Subject: [PATCH] server: Fix handling of GetMessage after previous PeekMessage @@ -93,10 +93,10 @@ index 398bb0a69ed..2aec627604c 100644 * because both messages are in the same queue. */ diff --git a/server/queue.c b/server/queue.c -index 53306f46793..3cf1a20926d 100644 +index 4f58b795b7e..3fa5c05214e 100644 --- a/server/queue.c +++ b/server/queue.c -@@ -147,6 +147,7 @@ struct msg_queue +@@ -143,6 +143,7 @@ struct msg_queue timeout_t last_get_msg; /* time of last get message call */ int keystate_lock; /* owns an input keystate lock */ const queue_shm_t *shared; /* queue in session shared memory */ @@ -104,7 +104,7 @@ index 53306f46793..3cf1a20926d 100644 }; struct hotkey -@@ -317,6 +318,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ +@@ -309,6 +310,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ queue->hooks = NULL; queue->last_get_msg = current_time; queue->keystate_lock = 0; @@ -112,7 +112,7 @@ index 53306f46793..3cf1a20926d 100644 list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); -@@ -712,13 +714,21 @@ static inline struct msg_queue *get_current_queue(void) +@@ -725,13 +727,21 @@ static inline struct msg_queue *get_current_queue(void) } /* get a (pseudo-)unique id to tag hardware messages */ @@ -135,7 +135,7 @@ index 53306f46793..3cf1a20926d 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 ) { -@@ -1029,7 +1039,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win ) +@@ -1042,7 +1052,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win ) } /* retrieve a posted message */ @@ -144,7 +144,7 @@ index 53306f46793..3cf1a20926d 100644 unsigned int first, unsigned int last, unsigned int flags, struct get_message_reply *reply ) { -@@ -1040,6 +1050,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win, +@@ -1053,6 +1063,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 53306f46793..3cf1a20926d 100644 goto found; /* found one */ } return 0; -@@ -1654,6 +1665,7 @@ found: +@@ -1676,6 +1687,7 @@ found: msg->msg = WM_HOTKEY; msg->wparam = hotkey->id; msg->lparam = ((hotkey->vkey & 0xffff) << 16) | modifiers; @@ -160,7 +160,7 @@ index 53306f46793..3cf1a20926d 100644 free( msg->data ); msg->data = NULL; -@@ -2624,7 +2636,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user +@@ -2646,7 +2658,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user } /* now we can return it */ @@ -169,7 +169,7 @@ index 53306f46793..3cf1a20926d 100644 reply->type = MSG_HARDWARE; reply->win = win; reply->msg = msg_code; -@@ -2731,6 +2743,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa +@@ -2753,6 +2765,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 53306f46793..3cf1a20926d 100644 get_message_defaults( thread->queue, &msg->x, &msg->y, &msg->time ); -@@ -3025,6 +3038,7 @@ DECL_HANDLER(send_message) +@@ -3070,6 +3083,7 @@ DECL_HANDLER(send_message) set_queue_bits( recv_queue, QS_SENDMESSAGE ); break; case MSG_POSTED: @@ -185,7 +185,7 @@ index 53306f46793..3cf1a20926d 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) -@@ -3151,12 +3165,12 @@ DECL_HANDLER(get_message) +@@ -3202,12 +3216,12 @@ DECL_HANDLER(get_message) /* then check for posted messages */ if ((filter & QS_POSTMESSAGE) && @@ -200,7 +200,7 @@ index 53306f46793..3cf1a20926d 100644 return; /* only check for quit messages if not posted messages pending */ -@@ -3167,7 +3181,7 @@ DECL_HANDLER(get_message) +@@ -3218,7 +3232,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 )) @@ -209,7 +209,7 @@ index 53306f46793..3cf1a20926d 100644 /* now check for WM_PAINT */ if ((filter & QS_PAINT) && -@@ -3180,7 +3194,7 @@ DECL_HANDLER(get_message) +@@ -3231,7 +3245,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 53306f46793..3cf1a20926d 100644 } /* now check for timer */ -@@ -3196,13 +3210,30 @@ DECL_HANDLER(get_message) +@@ -3247,9 +3261,19 @@ 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 ); @@ -237,8 +237,11 @@ index 53306f46793..3cf1a20926d 100644 + return; + if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event ); - queue->wake_mask = req->wake_mask; - queue->changed_mask = req->changed_mask; + + SHARED_WRITE_BEGIN( queue_shm, queue_shm_t ) +@@ -3260,6 +3284,13 @@ DECL_HANDLER(get_message) + SHARED_WRITE_END; + set_error( STATUS_PENDING ); /* FIXME */ + return; + @@ -250,7 +253,7 @@ index 53306f46793..3cf1a20926d 100644 } -@@ -3220,7 +3251,10 @@ DECL_HANDLER(reply_message) +@@ -3277,7 +3308,10 @@ DECL_HANDLER(reply_message) DECL_HANDLER(accept_hardware_message) { if (current->queue) diff --git a/staging/upstream-commit b/staging/upstream-commit index a7c41ef2..c672db64 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -b87f35898d22b90e36970e0b1fce1172ba64eb15 +17f052c36a414a05fcb6a6e67bd3aac824fbed3e