Rebase against 4ccf7498aac20b2b0afa2118f8d919718e5fcbbe.

This commit is contained in:
Zebediah Figura 2021-04-27 20:03:45 -05:00
parent 552dc36846
commit 592b9480ef
8 changed files with 56 additions and 56 deletions

View File

@ -1,4 +1,4 @@
From f2dc92d71f8d78d6396c6c98010d4709696ac43c Mon Sep 17 00:00:00 2001
From a1368a522fdc4e741fee7bfbd84eec632bcf4ce0 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 15:11:12 -0500
Subject: [PATCH] server: Create eventfd file descriptors for process objects.
@ -49,7 +49,7 @@ index 7ca4ca89394..6a0a367124d 100644
void esync_init(void);
+int esync_create_fd( int initval, int flags );
diff --git a/server/process.c b/server/process.c
index af7aef0cdac..0be707404f4 100644
index e144593445d..f9468c771d0 100644
--- a/server/process.c
+++ b/server/process.c
@@ -49,6 +49,7 @@
@ -77,7 +77,7 @@ index af7aef0cdac..0be707404f4 100644
no_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -555,6 +557,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
@@ -555,6 +557,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
process->trace_data = 0;
process->rawinput_mouse = NULL;
process->rawinput_kbd = NULL;
@ -85,7 +85,7 @@ index af7aef0cdac..0be707404f4 100644
list_init( &process->kernel_object );
list_init( &process->thread_list );
list_init( &process->locks );
@@ -609,6 +612,9 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
@@ -611,6 +614,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
if (!token_assign_label( process->token, security_high_label_sid ))
goto error;
@ -95,7 +95,7 @@ index af7aef0cdac..0be707404f4 100644
set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */
return process;
@@ -655,6 +661,7 @@ static void process_destroy( struct object *obj )
@@ -657,6 +663,7 @@ static void process_destroy( struct object *obj )
if (process->token) release_object( process->token );
free( process->dir_cache );
free( process->image );
@ -103,7 +103,7 @@ index af7aef0cdac..0be707404f4 100644
}
/* dump a process on stdout for debugging purposes */
@@ -672,6 +679,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
@@ -674,6 +681,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
return !process->running_threads;
}
@ -118,7 +118,7 @@ index af7aef0cdac..0be707404f4 100644
{
access = default_map_access( obj, access );
diff --git a/server/process.h b/server/process.h
index 0997a759330..638497857b3 100644
index 0e1a83859d9..71aae9c9494 100644
--- a/server/process.h
+++ b/server/process.h
@@ -87,6 +87,7 @@ struct process
@ -128,7 +128,7 @@ index 0997a759330..638497857b3 100644
+ int esync_fd; /* esync file descriptor (signaled on exit) */
};
#define CPU_FLAG(cpu) (1 << (cpu))
/* process functions */
--
2.30.1
2.30.2

View File

@ -1,4 +1,4 @@
From 6f58d9519f2f2c440e6e64159a09f877a4a83c88 Mon Sep 17 00:00:00 2001
From 7476e7b2e8680352cf2e1de7552ae58e11ff7869 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 15:19:37 -0500
Subject: [PATCH] ntdll, server: Implement waiting on server-bound objects.
@ -161,7 +161,7 @@ index 4f993689e0d..6fd195df759 100644
/* Don't grab the object, just check if it's signaled. */
if (fds[i].revents & POLLIN)
diff --git a/server/esync.c b/server/esync.c
index 61513333bfd..5f6e60ab24c 100644
index e18b76bff5b..2b9307267f9 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -315,6 +315,22 @@ int esync_create_fd( int initval, int flags )
@ -197,7 +197,7 @@ index 6a0a367124d..1e12560ddd6 100644
int esync_create_fd( int initval, int flags );
+void esync_wake_up( struct object *obj );
diff --git a/server/thread.c b/server/thread.c
index 1bde63120ed..abe1bd44982 100644
index 1e6f60182df..0413e889c7d 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -51,6 +51,7 @@
@ -207,8 +207,8 @@ index 1bde63120ed..abe1bd44982 100644
+#include "esync.h"
#ifdef __i386__
@@ -1047,6 +1048,9 @@ void wake_up( struct object *obj, int max )
/* thread queues */
@@ -1053,6 +1054,9 @@ void wake_up( struct object *obj, int max )
struct list *ptr;
int ret;
@ -219,5 +219,5 @@ index 1bde63120ed..abe1bd44982 100644
{
struct wait_queue_entry *entry = LIST_ENTRY( ptr, struct wait_queue_entry, entry );
--
2.28.0
2.30.2

View File

@ -1,4 +1,4 @@
From abe8fc2432fa484ab121005ad21a92c0c27668b7 Mon Sep 17 00:00:00 2001
From 39109644ddeb39a7a42c2f10657b35c515dfee46 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 17:17:31 -0500
Subject: [PATCH] ntdll, server: Implement alertable waits.
@ -164,10 +164,10 @@ index d1a282c65e9..2a7c3865617 100644
/* We need to let the server know when we are doing a message wait, and when we
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 1d6ba95d2a1..9c8e334aba6 100644
index a5bade02b8a..76eef4220c5 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -50,6 +50,7 @@ struct ntdll_thread_data
@@ -53,6 +53,7 @@ struct ntdll_thread_data
void *cpu_data[16]; /* reserved for CPU-specific data */
struct debug_info *debug_info; /* info for debugstr functions */
void *start_stack; /* stack for thread startup */
@ -176,19 +176,19 @@ index 1d6ba95d2a1..9c8e334aba6 100644
int reply_fd; /* fd for receiving server replies */
int wait_fd[2]; /* fd for sleeping server requests */
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index c1e79a210f4..5631414bf4c 100644
index f3e6b612b93..04c31a473af 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2565,6 +2565,7 @@ static void init_teb( TEB *teb, PEB *peb )
InitializeListHead( &teb->ActivationContextStack.FrameListCache );
@@ -2876,6 +2876,7 @@ static TEB *init_teb( void *ptr, PEB *peb )
teb->StaticUnicodeString.Buffer = teb->StaticUnicodeBuffer;
teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch;
+ thread_data->esync_apc_fd = -1;
thread_data->request_fd = -1;
thread_data->reply_fd = -1;
thread_data->wait_fd[0] = -1;
diff --git a/server/esync.c b/server/esync.c
index 7b5b0761516..33a448d0a57 100644
index ad5403bd4e0..3aa3a22df68 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -348,19 +348,25 @@ int esync_create_fd( int initval, int flags )
@ -244,10 +244,10 @@ index aeb58c5469c..cea025d9308 100644
void esync_clear( int fd );
diff --git a/server/protocol.def b/server/protocol.def
index f2ad5a88b28..56237afdcad 100644
index 00c89cce793..bb45c509685 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3717,3 +3717,7 @@ enum esync_type
@@ -3738,3 +3738,7 @@ enum esync_type
@REQ(esync_msgwait)
int in_msgwait; /* are we in a message wait? */
@END
@ -256,7 +256,7 @@ index f2ad5a88b28..56237afdcad 100644
+@REQ(get_esync_apc_fd)
+@END
diff --git a/server/thread.c b/server/thread.c
index 48c3eae7413..83f80740a46 100644
index 409a28129b3..e4781e57c8c 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -227,6 +227,7 @@ static inline void init_thread_structure( struct thread *thread )
@ -267,7 +267,7 @@ index 48c3eae7413..83f80740a46 100644
thread->system_regs = 0;
thread->queue = NULL;
thread->wait = NULL;
@@ -363,7 +364,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
@@ -374,7 +375,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
}
if (do_esync())
@ -278,7 +278,7 @@ index 48c3eae7413..83f80740a46 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
@@ -1150,8 +1154,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
@@ -1156,8 +1160,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
grab_object( apc );
list_add_tail( queue, &apc->entry );
if (!list_prev( queue, &apc->entry )) /* first one */
@ -292,7 +292,7 @@ index 48c3eae7413..83f80740a46 100644
return 1;
}
@@ -1197,6 +1206,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
@@ -1203,6 +1212,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
apc = LIST_ENTRY( ptr, struct thread_apc, entry );
list_remove( ptr );
}
@ -304,7 +304,7 @@ index 48c3eae7413..83f80740a46 100644
}
diff --git a/server/thread.h b/server/thread.h
index 99904557d44..f41c3ddd61e 100644
index 1eb501cbd52..13e4628d89a 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -55,6 +55,7 @@ struct thread
@ -316,5 +316,5 @@ index 99904557d44..f41c3ddd61e 100644
struct msg_queue *queue; /* message queue */
struct thread_wait *wait; /* current wait condition if sleeping */
--
2.29.2
2.30.2

View File

@ -1,7 +1,7 @@
From 0fdd0e4d59af06ed8b225e87802001ab53cb4906 Mon Sep 17 00:00:00 2001
From 5ac57c442cc9ce10ee8b8e0e82d3e3c199bd3862 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Mon, 31 Aug 2020 22:56:03 -0500
Subject: [PATCH 03/13] ntdll: Use a separate mutex to lock the TEB list.
Subject: [PATCH] ntdll: Use a separate mutex to lock the TEB list.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
@ -9,10 +9,10 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 785583a340a..2e5e94f80f8 100644
index f3e6b612b93..f0cec5e1347 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -163,6 +163,7 @@ static void *teb_block;
@@ -175,6 +175,7 @@ static void *teb_block;
static void **next_free_teb;
static int teb_block_pos;
static struct list teb_list = LIST_INIT( teb_list );
@ -20,27 +20,27 @@ index 785583a340a..2e5e94f80f8 100644
#define ROUND_ADDR(addr,mask) ((void *)((UINT_PTR)(addr) & ~(UINT_PTR)(mask)))
#define ROUND_SIZE(addr,size) (((SIZE_T)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask)
@@ -2556,7 +2557,9 @@ static void init_teb( TEB *teb, PEB *peb )
@@ -2880,7 +2881,9 @@ static TEB *init_teb( void *ptr, PEB *peb )
thread_data->reply_fd = -1;
thread_data->wait_fd[0] = -1;
thread_data->wait_fd[1] = -1;
+ pthread_rwlock_wrlock( &teb_list_lock );
list_add_head( &teb_list, &thread_data->entry );
+ pthread_rwlock_unlock( &teb_list_lock );
return teb;
}
@@ -2678,7 +2681,9 @@ void virtual_free_teb( TEB *teb )
@@ -2997,7 +3000,9 @@ void virtual_free_teb( TEB *teb )
}
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
+ pthread_rwlock_wrlock( &teb_list_lock );
list_remove( &thread_data->entry );
+ pthread_rwlock_unlock( &teb_list_lock );
ptr = (char *)teb - teb_offset;
if (!is_win64) ptr = (char *)ptr - teb_offset;
*(void **)ptr = next_free_teb;
next_free_teb = ptr;
@@ -2692,17 +2697,16 @@ void virtual_free_teb( TEB *teb )
@@ -3011,17 +3016,16 @@ void virtual_free_teb( TEB *teb )
NTSTATUS virtual_clear_tls_index( ULONG index )
{
struct ntdll_thread_data *thread_data;
@ -60,7 +60,7 @@ index 785583a340a..2e5e94f80f8 100644
}
else
{
@@ -2710,13 +2714,13 @@ NTSTATUS virtual_clear_tls_index( ULONG index )
@@ -3029,13 +3033,13 @@ NTSTATUS virtual_clear_tls_index( ULONG index )
if (index >= 8 * sizeof(NtCurrentTeb()->Peb->TlsExpansionBitmapBits))
return STATUS_INVALID_PARAMETER;
@ -77,5 +77,5 @@ index 785583a340a..2e5e94f80f8 100644
return STATUS_SUCCESS;
}
--
2.29.2
2.30.2

View File

@ -1,4 +1,4 @@
From 17e0fb2e0be8d53b485c96941faaa76d30d0c032 Mon Sep 17 00:00:00 2001
From 32902deea99f78645f82f283f5cde453607cec1d Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Mon, 31 Aug 2020 23:03:34 -0500
Subject: [PATCH] ntdll: Implement thread-id alerts on top of Mach semaphores
@ -88,10 +88,10 @@ index f4f87ba5642..7d6423083e1 100644
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 87f5a97131e..e97a9657f03 100644
index bfcd7bf04a7..9b3c9a91abc 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -252,7 +252,11 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
@@ -262,7 +262,11 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT
thread_data->start = start;
thread_data->param = param;
@ -104,7 +104,7 @@ index 87f5a97131e..e97a9657f03 100644
pthread_attr_init( &pthread_attr );
pthread_attr_setstack( &pthread_attr, teb->DeallocationStack,
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 2da19c6844f..3c4d5dd8a2b 100644
index 4c38ed8ef29..3d629de09b2 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -27,6 +27,11 @@
@ -117,9 +117,9 @@ index 2da19c6844f..3c4d5dd8a2b 100644
+#endif
+
#ifdef __i386__
static const enum cpu_type client_cpu = CPU_x86;
static const WORD current_machine = IMAGE_FILE_MACHINE_I386;
@@ -62,10 +67,14 @@ struct ntdll_thread_data
#elif defined(__x86_64__)
@@ -60,10 +65,14 @@ struct ntdll_thread_data
struct list entry; /* entry in TEB list */
PRTL_THREAD_START_ROUTINE start; /* thread entry point */
void *param; /* thread entry point parameter */
@ -135,5 +135,5 @@ index 2da19c6844f..3c4d5dd8a2b 100644
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
--
2.20.1
2.30.2

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "c0af8b73725d2670c9b018a255c503dee6912cf5"
echo "4ccf7498aac20b2b0afa2118f8d919718e5fcbbe"
}
# Show version information

View File

@ -1,4 +1,4 @@
From 13f3b44e8f40766cc8ee4e59908bf83844c10255 Mon Sep 17 00:00:00 2001
From f3b9bbdd8acf2918aa9e1f17227c70ab24c4651c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 29 May 2017 05:30:44 +0200
Subject: [PATCH] user32/tests: Add tests for clicking through layered window.
@ -15,7 +15,7 @@ FIXME:
1 file changed, 156 insertions(+)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index d0117f2ac5b..af6cc2cb69f 100644
index 5135a2456cb..5bae753be6f 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -52,6 +52,7 @@
@ -24,9 +24,9 @@ index d0117f2ac5b..af6cc2cb69f 100644
#include "winuser.h"
+#include "wingdi.h"
#include "winnls.h"
#include "winreg.h"
#include "ddk/hidsdi.h"
@@ -2704,6 +2705,7 @@ static void test_Input_mouse(void)
@@ -3252,6 +3253,7 @@ static void test_Input_mouse(void)
struct thread_data thread_data;
HANDLE thread;
DWORD thread_id;
@ -34,7 +34,7 @@ index d0117f2ac5b..af6cc2cb69f 100644
POINT pt, pt_org;
MSG msg;
BOOL ret;
@@ -2918,6 +2920,160 @@ static void test_Input_mouse(void)
@@ -3466,6 +3468,160 @@ static void test_Input_mouse(void)
ok(got_button_up, "expected WM_LBUTTONUP message\n");
DestroyWindow(hwnd);
ok(ReleaseCapture(), "ReleaseCapture failed\n");
@ -196,5 +196,5 @@ index d0117f2ac5b..af6cc2cb69f 100644
CloseHandle(thread_data.start_event);
--
2.27.0
2.30.2

View File

@ -1 +1 @@
c0af8b73725d2670c9b018a255c503dee6912cf5
4ccf7498aac20b2b0afa2118f8d919718e5fcbbe