Rebase against 07544942e2c9c2f35263adb5104998f18967dc6c.

This commit is contained in:
Alistair Leslie-Hughes 2024-06-27 08:37:31 +10:00
parent 7fc08a960b
commit 1b9ef03b2c
5 changed files with 65 additions and 61 deletions

View File

@ -1,4 +1,4 @@
From f0248f536027bb22efae2f92e180046c075a87c1 Mon Sep 17 00:00:00 2001
From 1e7b6a812b248a8344076a402fc97bd60da495d1 Mon Sep 17 00:00:00 2001
From: Jason Edmeades <us@edmeades.me.uk>
Date: Tue, 16 Jul 2019 13:49:18 +1000
Subject: [PATCH] cmd: Support for launching programs based on file association
@ -15,10 +15,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
1 file changed, 102 insertions(+), 37 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index ce083e710f7..2aad90e350d 100644
index 12d3db1b012..0f222f3640b 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1483,8 +1483,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1494,8 +1494,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* 1. If extension supplied, see if that file exists */
if (extensionsupplied) {
@ -30,7 +30,7 @@ index ce083e710f7..2aad90e350d 100644
}
}
@@ -1514,6 +1516,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1525,6 +1527,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
}
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
@ -38,14 +38,17 @@ index ce083e710f7..2aad90e350d 100644
found = TRUE;
thisExt = NULL;
}
@@ -1535,52 +1538,114 @@ void WCMD_run_program (WCHAR *command, BOOL called)
@@ -1546,6 +1549,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
/* Special case BAT and CMD */
if (ext && (!wcsicmp(ext, L".bat") || !wcsicmp(ext, L".cmd"))) {
BOOL oldinteractive = interactive;
+ WINE_TRACE("Calling batch program\n");
interactive = FALSE;
WCMD_batch (thisDir, command, called, NULL, INVALID_HANDLE_VALUE);
WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE);
interactive = oldinteractive;
@@ -1554,48 +1558,109 @@ void WCMD_run_program (WCHAR *command, BOOL called)
context->skip_rest = TRUE;
}
return;
- } else {
- DWORD exit_code;

View File

@ -1,4 +1,4 @@
From 61e2cd91e7eb3654e6663a44d950f40808c4f30b Mon Sep 17 00:00:00 2001
From f1fcc584ff2bb975656b9f2f111d3e09b36293d0 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:01:56 -0500
Subject: [PATCH] server: Create eventfd file descriptors for message queues.
@ -8,10 +8,10 @@ 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 0aa8888d646..e29764f7870 100644
index 4d3f43b8d52..74a59b2ee84 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -42,6 +42,7 @@
@@ -44,6 +44,7 @@
#include "process.h"
#include "request.h"
#include "user.h"
@ -19,15 +19,15 @@ index 0aa8888d646..e29764f7870 100644
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
@@ -143,6 +144,7 @@ struct msg_queue
timeout_t last_get_msg; /* time of last get message call */
@@ -148,6 +149,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 */
+ int esync_fd; /* esync file descriptor (signalled on message) */
};
struct hotkey
@@ -159,6 +161,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
@@ -164,6 +166,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 0aa8888d646..e29764f7870 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 );
@@ -174,7 +177,7 @@ static const struct object_ops msg_queue_ops =
@@ -179,7 +182,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 0aa8888d646..e29764f7870 100644
msg_queue_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -314,12 +317,16 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -321,6 +324,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,16 +52,17 @@ index 0aa8888d646..e29764f7870 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
list_init( &queue->expired_timers );
for (i = 0; i < NB_MSG_KINDS; i++) list_init( &queue->msg_list[i] );
@@ -339,6 +343,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
}
SHARED_WRITE_END;
+ if (do_esync())
+ queue->esync_fd = esync_create_fd( 0, 0 );
+
thread->queue = queue;
}
if (new_input) release_object( new_input );
@@ -533,6 +540,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
if ((desktop = get_thread_desktop( thread, 0 )))
@@ -672,6 +679,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;
}
@ -71,7 +72,7 @@ index 0aa8888d646..e29764f7870 100644
}
/* check if message is matched by the filter */
@@ -1040,6 +1050,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
@@ -1213,6 +1223,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
return ret || is_signaled( queue );
}
@ -85,15 +86,15 @@ index 0aa8888d646..e29764f7870 100644
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
{
struct msg_queue *queue = (struct msg_queue *)obj;
@@ -1084,6 +1101,7 @@ static void msg_queue_destroy( struct object *obj )
release_object( queue->input );
@@ -1258,6 +1275,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 );
+ if (do_esync()) close( queue->esync_fd );
}
static void msg_queue_poll_event( struct fd *fd, int event )
@@ -2458,6 +2476,9 @@ DECL_HANDLER(set_queue_mask)
@@ -2962,6 +2980,9 @@ DECL_HANDLER(set_queue_mask)
if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
else wake_up( &queue->obj, 0 );
}
@ -103,7 +104,7 @@ index 0aa8888d646..e29764f7870 100644
}
}
@@ -2471,6 +2492,9 @@ DECL_HANDLER(get_queue_status)
@@ -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;
@ -113,7 +114,7 @@ index 0aa8888d646..e29764f7870 100644
}
else reply->wake_bits = reply->changed_bits = 0;
}
@@ -2717,6 +2741,10 @@ DECL_HANDLER(get_message)
@@ -3229,6 +3253,10 @@ DECL_HANDLER(get_message)
queue->wake_mask = req->wake_mask;
queue->changed_mask = req->changed_mask;
set_error( STATUS_PENDING ); /* FIXME */
@ -125,5 +126,5 @@ index 0aa8888d646..e29764f7870 100644
found_msg:
--
2.40.1
2.43.0

View File

@ -1,13 +1,13 @@
From 465a4772356f406552cc20bddec820a4e197b667 Mon Sep 17 00:00:00 2001
From 57703c0423cf2b138b93dfaf4bd993d50235e55a Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:11:23 -0500
Subject: [PATCH] server, ntdll: Implement message waits.
---
dlls/ntdll/unix/esync.c | 51 +++++++++++++++++++++++++++++++++++++++--
server/protocol.def | 5 ++++
server/protocol.def | 4 ++++
server/queue.c | 22 ++++++++++++++++++
3 files changed, 76 insertions(+), 2 deletions(-)
3 files changed, 75 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 4ab6b97ba93..d28c1a6f5fa 100644
index d4a7173776f..4a081973ca5 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3910,6 +3910,10 @@ enum esync_type
@@ -3964,6 +3964,10 @@ enum esync_type
unsigned int shm_idx;
@END
@ -120,18 +120,18 @@ index 4ab6b97ba93..d28c1a6f5fa 100644
@REQ(set_keyboard_repeat)
int enable; /* whether to enable auto-repeat */
diff --git a/server/queue.c b/server/queue.c
index 1568355104c..b68774d7524 100644
index 6183c2fa686..260fb753799 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -149,6 +149,7 @@ struct msg_queue
int keystate_lock; /* owns an input keystate lock */
@@ -150,6 +150,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) */
+ int esync_in_msgwait; /* our thread is currently waiting on us */
};
struct hotkey
@@ -322,6 +323,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -325,6 +326,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 1568355104c..b68774d7524 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -1115,6 +1117,10 @@ static int is_queue_hung( struct msg_queue *queue )
@@ -1170,6 +1172,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,7 +150,7 @@ index 1568355104c..b68774d7524 100644
return 1;
}
@@ -3923,6 +3929,21 @@ DECL_HANDLER(update_rawinput_devices)
@@ -4025,6 +4031,21 @@ DECL_HANDLER(update_rawinput_devices)
}
}
@ -172,7 +172,7 @@ index 1568355104c..b68774d7524 100644
DECL_HANDLER(set_keyboard_repeat)
{
struct desktop *desktop;
@@ -3941,3 +3962,4 @@ DECL_HANDLER(set_keyboard_repeat)
@@ -4043,3 +4064,4 @@ DECL_HANDLER(set_keyboard_repeat)
release_object( desktop );
}

View File

@ -1,4 +1,4 @@
From 898c8d269bdcda704a2a923349d2a1967a1f23eb Mon Sep 17 00:00:00 2001
From f53204bf14a0ac962d389467e9e915724639ad03 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 1169d82271c..bee49c302cb 100644
index 398bb0a69ed..2aec627604c 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -14329,13 +14329,10 @@ static void test_PeekMessage3(void)
@@ -14353,13 +14353,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 1169d82271c..bee49c302cb 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);
@@ -14345,10 +14342,8 @@ static void test_PeekMessage3(void)
@@ -14369,10 +14366,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 1169d82271c..bee49c302cb 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);
@@ -14360,10 +14355,11 @@ static void test_PeekMessage3(void)
@@ -14384,10 +14379,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 1169d82271c..bee49c302cb 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);
@@ -14391,14 +14387,32 @@ static void test_PeekMessage3(void)
@@ -14415,14 +14411,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,18 +93,18 @@ index 1169d82271c..bee49c302cb 100644
* because both messages are in the same queue. */
diff --git a/server/queue.c b/server/queue.c
index ed099b3b989..35926b701af 100644
index 53306f46793..3cf1a20926d 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -145,6 +145,7 @@ struct msg_queue
struct hook_table *hooks; /* hook table */
@@ -147,6 +147,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 */
+ unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
};
struct hotkey
@@ -313,6 +314,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->hooks = NULL;
queue->last_get_msg = current_time;
queue->keystate_lock = 0;
@ -112,7 +112,7 @@ index ed099b3b989..35926b701af 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -656,13 +658,21 @@ static inline struct msg_queue *get_current_queue(void)
@@ -712,13 +714,21 @@ static inline struct msg_queue *get_current_queue(void)
}
/* get a (pseudo-)unique id to tag hardware messages */
@ -135,7 +135,7 @@ index ed099b3b989..35926b701af 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 )
{
@@ -973,7 +983,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
@@ -1029,7 +1039,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win )
}
/* retrieve a posted message */
@ -144,7 +144,7 @@ index ed099b3b989..35926b701af 100644
unsigned int first, unsigned int last, unsigned int flags,
struct get_message_reply *reply )
{
@@ -984,6 +994,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win,
@@ -1040,6 +1050,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 ed099b3b989..35926b701af 100644
goto found; /* found one */
}
return 0;
@@ -1598,6 +1609,7 @@ found:
@@ -1654,6 +1665,7 @@ found:
msg->msg = WM_HOTKEY;
msg->wparam = hotkey->id;
msg->lparam = ((hotkey->vkey & 0xffff) << 16) | modifiers;
@ -160,7 +160,7 @@ index ed099b3b989..35926b701af 100644
free( msg->data );
msg->data = NULL;
@@ -2503,7 +2515,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
@@ -2624,7 +2636,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
}
/* now we can return it */
@ -169,7 +169,7 @@ index ed099b3b989..35926b701af 100644
reply->type = MSG_HARDWARE;
reply->win = win;
reply->msg = msg_code;
@@ -2610,6 +2622,7 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa
@@ -2731,6 +2743,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 ed099b3b989..35926b701af 100644
get_message_defaults( thread->queue, &msg->x, &msg->y, &msg->time );
@@ -2896,6 +2909,7 @@ DECL_HANDLER(send_message)
@@ -3025,6 +3038,7 @@ DECL_HANDLER(send_message)
set_queue_bits( recv_queue, QS_SENDMESSAGE );
break;
case MSG_POSTED:
@ -185,7 +185,7 @@ index ed099b3b989..35926b701af 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)
@@ -3022,12 +3036,12 @@ DECL_HANDLER(get_message)
@@ -3151,12 +3165,12 @@ DECL_HANDLER(get_message)
/* then check for posted messages */
if ((filter & QS_POSTMESSAGE) &&
@ -200,7 +200,7 @@ index ed099b3b989..35926b701af 100644
return;
/* only check for quit messages if not posted messages pending */
@@ -3038,7 +3052,7 @@ DECL_HANDLER(get_message)
@@ -3167,7 +3181,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 ed099b3b989..35926b701af 100644
/* now check for WM_PAINT */
if ((filter & QS_PAINT) &&
@@ -3051,7 +3065,7 @@ DECL_HANDLER(get_message)
@@ -3180,7 +3194,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 ed099b3b989..35926b701af 100644
}
/* now check for timer */
@@ -3067,13 +3081,30 @@ DECL_HANDLER(get_message)
@@ -3196,13 +3210,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 ed099b3b989..35926b701af 100644
}
@@ -3091,7 +3122,10 @@ DECL_HANDLER(reply_message)
@@ -3220,7 +3251,10 @@ DECL_HANDLER(reply_message)
DECL_HANDLER(accept_hardware_message)
{
if (current->queue)

View File

@ -1 +1 @@
f9af971bd7d6799d54436ba9f7fa327b7edfbc77
07544942e2c9c2f35263adb5104998f18967dc6c