Rebase against cfbbde2abce1eedc7f53db3f8af8078fe4a11cac.

This commit is contained in:
Alistair Leslie-Hughes 2021-02-02 10:51:17 +11:00
parent f6dacd2f9a
commit a6054cf2e9
10 changed files with 61 additions and 249 deletions

View File

@ -1,4 +1,4 @@
From 882fe7c0815814c912722d663c981c411e7314f5 Mon Sep 17 00:00:00 2001
From 88819d39a698afb9024eb37d233cdddf490a0930 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Fri, 8 Jun 2018 22:04:29 -0500
Subject: [PATCH] server: Create eventfd file descriptors for thread objects.
@ -9,7 +9,7 @@ Subject: [PATCH] server: Create eventfd file descriptors for thread objects.
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/server/thread.c b/server/thread.c
index 2d2a80a61ef..c52057d1f50 100644
index 0fddc37856a..48c3eae7413 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -172,6 +172,7 @@ static const struct object_ops context_ops =
@ -34,10 +34,10 @@ index 2d2a80a61ef..c52057d1f50 100644
thread->teb = 0;
thread->entry_point = 0;
+ thread->esync_fd = -1;
thread->debug_obj = NULL;
thread->system_regs = 0;
thread->queue = NULL;
@@ -361,6 +363,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
thread->wait = NULL;
@@ -360,6 +362,9 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
return NULL;
}
@ -47,7 +47,7 @@ index 2d2a80a61ef..c52057d1f50 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
return thread;
@@ -441,6 +446,9 @@ static void destroy_thread( struct object *obj )
@@ -439,6 +444,9 @@ static void destroy_thread( struct object *obj )
if (thread->exit_poll) remove_timeout_user( thread->exit_poll );
if (thread->id) free_ptid( thread->id );
if (thread->token) release_object( thread->token );
@ -57,7 +57,7 @@ index 2d2a80a61ef..c52057d1f50 100644
}
/* dump a thread on stdout for debugging purposes */
@@ -466,6 +474,13 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
@@ -464,6 +472,13 @@ static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
return mythread->state == TERMINATED && !mythread->exit_poll;
}
@ -72,7 +72,7 @@ index 2d2a80a61ef..c52057d1f50 100644
{
if (access & GENERIC_READ) access |= STANDARD_RIGHTS_READ | THREAD_QUERY_INFORMATION | THREAD_GET_CONTEXT;
diff --git a/server/thread.h b/server/thread.h
index 4a8c5b1cb2c..e6a9f987c9e 100644
index 077ab0929ba..99904557d44 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -54,6 +54,7 @@ struct thread
@ -80,9 +80,9 @@ index 4a8c5b1cb2c..e6a9f987c9e 100644
thread_id_t id; /* thread id */
struct list mutex_list; /* list of currently owned mutexes */
+ int esync_fd; /* esync file descriptor (signalled on exit) */
struct debug_obj *debug_obj; /* debugger context if this thread is a debugger */
unsigned int system_regs; /* which system regs have been set */
struct msg_queue *queue; /* message queue */
struct thread_wait *wait; /* current wait condition if sleeping */
--
2.29.2

View File

@ -1,4 +1,4 @@
From 607d2418e9997885192791cb54a9cdfdaf77eee1 Mon Sep 17 00:00:00 2001
From abe8fc2432fa484ab121005ad21a92c0c27668b7 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.
@ -244,10 +244,10 @@ index aeb58c5469c..cea025d9308 100644
void esync_clear( int fd );
diff --git a/server/protocol.def b/server/protocol.def
index e60d6f7e8dd..34eaff6207c 100644
index f2ad5a88b28..56237afdcad 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3718,3 +3718,7 @@ enum esync_type
@@ -3717,3 +3717,7 @@ enum esync_type
@REQ(esync_msgwait)
int in_msgwait; /* are we in a message wait? */
@END
@ -256,7 +256,7 @@ index e60d6f7e8dd..34eaff6207c 100644
+@REQ(get_esync_apc_fd)
+@END
diff --git a/server/thread.c b/server/thread.c
index c52057d1f50..0b905e6a155 100644
index 48c3eae7413..83f80740a46 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -227,6 +227,7 @@ static inline void init_thread_structure( struct thread *thread )
@ -264,10 +264,10 @@ index c52057d1f50..0b905e6a155 100644
thread->entry_point = 0;
thread->esync_fd = -1;
+ thread->esync_apc_fd = -1;
thread->debug_obj = NULL;
thread->system_regs = 0;
thread->queue = NULL;
@@ -364,7 +365,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
thread->wait = NULL;
@@ -363,7 +364,10 @@ struct thread *create_thread( int fd, struct process *process, const struct secu
}
if (do_esync())
@ -278,7 +278,7 @@ index c52057d1f50..0b905e6a155 100644
set_fd_events( thread->request_fd, POLLIN ); /* start listening to events */
add_process_thread( thread->process, thread );
@@ -1152,8 +1156,13 @@ static int queue_apc( struct process *process, struct thread *thread, struct thr
@@ -1150,8 +1154,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 c52057d1f50..0b905e6a155 100644
return 1;
}
@@ -1199,6 +1208,10 @@ static struct thread_apc *thread_dequeue_apc( struct thread *thread, int system
@@ -1197,6 +1206,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 c52057d1f50..0b905e6a155 100644
}
diff --git a/server/thread.h b/server/thread.h
index e6a9f987c9e..ff86da99798 100644
index 99904557d44..f41c3ddd61e 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -55,6 +55,7 @@ struct thread
@ -312,9 +312,9 @@ index e6a9f987c9e..ff86da99798 100644
struct list mutex_list; /* list of currently owned mutexes */
int esync_fd; /* esync file descriptor (signalled on exit) */
+ int esync_apc_fd; /* esync apc fd (signalled when APCs are present) */
struct debug_obj *debug_obj; /* debugger context if this thread is a debugger */
unsigned int system_regs; /* which system regs have been set */
struct msg_queue *queue; /* message queue */
struct thread_wait *wait; /* current wait condition if sleeping */
--
2.29.2

View File

@ -1,4 +1,4 @@
From 5126b7e8cd315c7e85d84b897fd2d271d62d91c1 Mon Sep 17 00:00:00 2001
From 075bdc732f12d42184ee6a906f58051739972322 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 18:01:32 -0500
Subject: [PATCH] ntdll, server: Abandon esync mutexes on thread exit.
@ -175,12 +175,12 @@ index cea025d9308..125da8e9d12 100644
void esync_reset_event( struct esync *esync );
+void esync_abandon_mutexes( struct thread *thread );
diff --git a/server/thread.c b/server/thread.c
index 6fb8684f5e0..f320f2b26e9 100644
index 83f80740a46..bffe229586f 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -1328,6 +1328,8 @@ void kill_thread( struct thread *thread, int violent_death )
@@ -1325,6 +1325,8 @@ void kill_thread( struct thread *thread, int violent_death )
}
kill_console_processes( thread, 0 );
debug_exit_thread( thread );
abandon_mutexes( thread );
+ if (do_esync())
+ esync_abandon_mutexes( thread );
@ -188,5 +188,5 @@ index 6fb8684f5e0..f320f2b26e9 100644
{
send_thread_signal( thread, SIGQUIT );
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From 3606a80ff21447e459950899b409416873722031 Mon Sep 17 00:00:00 2001
From d8919e4d3790e738ec0cb09907609f4fde8f29e7 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Mon, 31 Aug 2020 23:00:16 -0500
Subject: [PATCH 04/13] ntdll: Implement NtAlertThreadByThreadId() and
Subject: [PATCH] ntdll: Implement NtAlertThreadByThreadId() and
NtWaitForAlertByThreadId().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
@ -12,10 +12,11 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
dlls/ntdll/unix/unix_private.h | 3 +++
dlls/ntdll/unix/virtual.c | 5 ++--
include/winternl.h | 2 ++
6 files changed, 57 insertions(+), 2 deletions(-)
server/thread.c | 2 +-
7 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index f5ac924a945..c63b7a3e5fe 100644
index 0a2c2493334..c4a21991562 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -137,6 +137,7 @@
@ -26,19 +27,19 @@ index f5ac924a945..c63b7a3e5fe 100644
@ stdcall -syscall NtAllocateLocallyUniqueId(ptr)
# @ stub NtAllocateUserPhysicalPages
@ stdcall -syscall NtAllocateUuids(ptr ptr ptr ptr)
@@ -422,6 +423,7 @@
@ stdcall -syscall NtUnmapViewOfSection(long ptr)
@@ -423,6 +424,7 @@
@ stub NtVdmControl
@ stub NtW32Call
@ stdcall -syscall NtWaitForDebugEvent(long long ptr ptr)
+@ stdcall -syscall NtWaitForAlertByThreadId(ptr ptr)
# @ stub NtWaitForDebugEvent
@ stdcall -syscall NtWaitForKeyedEvent(long ptr long ptr)
@ stdcall -syscall NtWaitForMultipleObjects(long ptr long long ptr)
@ stub NtWaitForProcessMutant
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index dcc8c5447ef..2ed164368b9 100644
index 32ee7a52b99..587f0858600 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -81,6 +81,12 @@ static const LARGE_INTEGER zero_timeout;
@@ -82,6 +82,12 @@ static const LARGE_INTEGER zero_timeout;
static pthread_mutex_t addr_mutex = PTHREAD_MUTEX_INITIALIZER;
@ -51,7 +52,7 @@ index dcc8c5447ef..2ed164368b9 100644
/* return a monotonic time counter, in Win32 ticks */
static inline ULONGLONG monotonic_counter(void)
{
@@ -2119,6 +2125,45 @@ NTSTATUS WINAPI NtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS cl
@@ -2336,6 +2342,45 @@ NTSTATUS WINAPI NtQueryInformationAtom( RTL_ATOM atom, ATOM_INFORMATION_CLASS cl
}
@ -111,10 +112,10 @@ index 9808fc610e3..bb55b3d29ed 100644
pthread_attr_setstack( &pthread_attr, teb->DeallocationStack,
(char *)teb->Tib.StackBase + extra_stack - (char *)teb->DeallocationStack );
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 23731f0fdc6..9ae7cba34a7 100644
index 68a24d97cfd..1880ce51b6e 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -57,6 +57,7 @@ struct ntdll_thread_data
@@ -59,6 +59,7 @@ 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 */
@ -122,7 +123,7 @@ index 23731f0fdc6..9ae7cba34a7 100644
};
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
@@ -113,6 +114,8 @@ extern NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT
@@ -115,6 +116,8 @@ extern NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT
extern void CDECL set_show_dot_files( BOOL enable ) DECLSPEC_HIDDEN;
@ -132,10 +133,10 @@ index 23731f0fdc6..9ae7cba34a7 100644
extern const char *data_dir DECLSPEC_HIDDEN;
extern const char *build_dir DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index 2e5e94f80f8..96650e064c3 100644
index 34eadfd3d37..a136390c994 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -162,8 +162,9 @@ struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000;
@@ -164,8 +164,9 @@ struct _KUSER_SHARED_DATA *user_shared_data = (void *)0x7ffe0000;
static void *teb_block;
static void **next_free_teb;
static int teb_block_pos;
@ -148,10 +149,10 @@ index 2e5e94f80f8..96650e064c3 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)
diff --git a/include/winternl.h b/include/winternl.h
index a7b0e04aade..b155b4e39b2 100644
index 4d8b5841d17..a388e9e7741 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -3040,6 +3040,7 @@ NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG
@@ -3213,6 +3213,7 @@ NTSYSAPI NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG
NTSYSAPI NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
NTSYSAPI NTSTATUS WINAPI NtAlertResumeThread(HANDLE,PULONG);
NTSYSAPI NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
@ -159,10 +160,10 @@ index a7b0e04aade..b155b4e39b2 100644
NTSYSAPI NTSTATUS WINAPI NtAllocateLocallyUniqueId(PLUID lpLuid);
NTSYSAPI NTSTATUS WINAPI NtAllocateUuids(PULARGE_INTEGER,PULONG,PULONG,PUCHAR);
NTSYSAPI NTSTATUS WINAPI NtAllocateVirtualMemory(HANDLE,PVOID*,ULONG_PTR,SIZE_T*,ULONG,ULONG);
@@ -3272,6 +3273,7 @@ NTSYSAPI NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PL
NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
@@ -3451,6 +3452,7 @@ NTSYSAPI NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
NTSYSAPI NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
NTSYSAPI NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
NTSYSAPI NTSTATUS WINAPI NtWaitForDebugEvent(HANDLE,BOOLEAN,LARGE_INTEGER*,DBGUI_WAIT_STATE_CHANGE*);
+NTSYSAPI NTSTATUS WINAPI NtWaitForAlertByThreadId(const void*,const LARGE_INTEGER*);
NTSYSAPI NTSTATUS WINAPI NtWaitForKeyedEvent(HANDLE,const void*,BOOLEAN,const LARGE_INTEGER*);
NTSYSAPI NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "47ac628b4a4e476c1b044765c95d5be2a7101d14"
echo "cfbbde2abce1eedc7f53db3f8af8078fe4a11cac"
}
# Show version information
@ -3304,7 +3304,7 @@ fi
# | * dlls/ntdll/Makefile.in, dlls/ntdll/critsection.c, dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, dlls/ntdll/sync.c,
# | dlls/ntdll/tests/Makefile.in, dlls/ntdll/tests/om.c, dlls/ntdll/tests/sync.c, dlls/ntdll/thread.c,
# | dlls/ntdll/unix/loader.c, dlls/ntdll/unix/sync.c, dlls/ntdll/unix/thread.c, dlls/ntdll/unix/unix_private.h,
# | dlls/ntdll/unix/virtual.c, dlls/ntdll/unixlib.h, include/winternl.h
# | dlls/ntdll/unix/virtual.c, dlls/ntdll/unixlib.h, include/winternl.h, server/thread.c
# |
if test "$enable_ntdll_NtAlertThreadByThreadId" -eq 1; then
patch_apply ntdll-NtAlertThreadByThreadId/0001-ntdll-tests-Move-some-tests-to-a-new-sync.c-file.patch
@ -4460,16 +4460,13 @@ fi
# | * [#49998] widl - Support WinRT idls
# |
# | Modified files:
# | * include/windows.foundation.idl, include/windows.media.speechsynthesis.idl, include/winnt.h, tools/widl/expr.c,
# | tools/widl/hash.c, tools/widl/hash.h, tools/widl/header.c, tools/widl/parser.l, tools/widl/parser.y,
# | tools/widl/typegen.c, tools/widl/typelib.c, tools/widl/typetree.c, tools/widl/typetree.h, tools/widl/utils.c,
# | tools/widl/utils.h, tools/widl/widltypes.h
# | * include/windows.foundation.idl, include/windows.media.speechsynthesis.idl, tools/widl/expr.c, tools/widl/hash.c,
# | tools/widl/hash.h, tools/widl/header.c, tools/widl/parser.l, tools/widl/parser.y, tools/widl/typegen.c,
# | tools/widl/typelib.c, tools/widl/typetree.c, tools/widl/typetree.h, tools/widl/utils.c, tools/widl/utils.h,
# | tools/widl/widltypes.h
# |
if test "$enable_widl_winrt_support" -eq 1; then
patch_apply widl-winrt-support/0001-include-Define-DECLSPEC_SELECTANY-on-MinGW.patch
patch_apply widl-winrt-support/0002-widl-Generate-WinRT-runtimeclass-name-constants.patch
patch_apply widl-winrt-support/0003-widl-Support-WinRT-eventadd-eventremove-attributes.patch
patch_apply widl-winrt-support/0004-widl-Support-WinRT-flags-attribute-parsing.patch
patch_apply widl-winrt-support/0005-widl-Support-using-qualified-names-for-interfaces.patch
patch_apply widl-winrt-support/0006-widl-Support-WinRT-static-attribute-parsing.patch
patch_apply widl-winrt-support/0007-widl-Support-WinRT-requires-keyword.patch

View File

@ -1,4 +1,4 @@
From d05ac476a0ca682ecb7ae13aa9e578c94b71e3f8 Mon Sep 17 00:00:00 2001
From f649ffcd8f68f82be173367b66f3c505ff75bcc3 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 12 Nov 2018 18:10:32 +0200
Subject: [PATCH] server: Do not signal violently terminated threads until they
@ -27,10 +27,10 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/server/thread.c b/server/thread.c
index 9b14174578e..2f32cb4b62e 100644
index 55386192fe6..60cd4ee16a8 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -239,6 +239,7 @@ static inline void init_thread_structure( struct thread *thread )
@@ -241,6 +241,7 @@ static inline void init_thread_structure( struct thread *thread )
thread->token = NULL;
thread->desc = NULL;
thread->desc_len = 0;
@ -38,7 +38,7 @@ index 9b14174578e..2f32cb4b62e 100644
thread->creation_time = current_time;
thread->exit_time = 0;
@@ -430,6 +431,7 @@ static void destroy_thread( struct object *obj )
@@ -431,6 +432,7 @@ static void destroy_thread( struct object *obj )
list_remove( &thread->entry );
cleanup_thread( thread );
release_object( thread->process );
@ -46,7 +46,7 @@ index 9b14174578e..2f32cb4b62e 100644
if (thread->id) free_ptid( thread->id );
if (thread->token) release_object( thread->token );
}
@@ -454,7 +456,7 @@ static struct object_type *thread_get_type( struct object *obj )
@@ -455,7 +457,7 @@ static struct object_type *thread_get_type( struct object *obj )
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
{
struct thread *mythread = (struct thread *)obj;
@ -55,7 +55,7 @@ index 9b14174578e..2f32cb4b62e 100644
}
static unsigned int thread_map_access( struct object *obj, unsigned int access )
@@ -1245,6 +1247,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
@@ -1249,6 +1251,26 @@ int thread_get_inflight_fd( struct thread *thread, int client )
return -1;
}
@ -82,9 +82,9 @@ index 9b14174578e..2f32cb4b62e 100644
/* kill a thread on the spot */
void kill_thread( struct thread *thread, int violent_death )
{
@@ -1265,8 +1287,12 @@ void kill_thread( struct thread *thread, int violent_death )
@@ -1268,8 +1290,12 @@ void kill_thread( struct thread *thread, int violent_death )
}
kill_console_processes( thread, 0 );
debug_exit_thread( thread );
abandon_mutexes( thread );
- wake_up( &thread->obj, 0 );
- if (violent_death) send_thread_signal( thread, SIGQUIT );
@ -98,10 +98,10 @@ index 9b14174578e..2f32cb4b62e 100644
remove_process_thread( thread->process, thread );
release_object( thread );
diff --git a/server/thread.h b/server/thread.h
index 650bc44628d..668cc4ebd79 100644
index 184fa92d250..077ab0929ba 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -91,6 +91,7 @@ struct thread
@@ -90,6 +90,7 @@ struct thread
struct list kernel_object; /* list of kernel object pointers */
data_size_t desc_len; /* thread description length in bytes */
WCHAR *desc; /* thread description string */
@ -110,5 +110,5 @@ index 650bc44628d..668cc4ebd79 100644
extern struct thread *current;
--
2.27.0
2.29.2

View File

@ -1,25 +0,0 @@
From 9c00130e319055e1b8fb336338e656f8ca5d64b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 19 Jan 2021 13:47:45 +0100
Subject: [PATCH] include: Define DECLSPEC_SELECTANY on MinGW.
---
include/winnt.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/winnt.h b/include/winnt.h
index 5b3efe61385..bb045fa2745 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -110,6 +110,8 @@ extern "C" {
#ifndef DECLSPEC_SELECTANY
#if defined(_MSC_VER) && (_MSC_VER >= 1100)
#define DECLSPEC_SELECTANY __declspec(selectany)
+#elif defined(__MINGW32__)
+#define DECLSPEC_SELECTANY __attribute__((selectany))
#else
#define DECLSPEC_SELECTANY
#endif
--
2.29.2

View File

@ -1,95 +0,0 @@
From 6ecf89d3afe33a136e41c0106adeb0b27fe74c7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 1 Oct 2020 20:10:02 +0200
Subject: [PATCH] widl: Support WinRT eventadd/eventremove attributes.
---
tools/widl/header.c | 4 ++++
tools/widl/parser.l | 2 ++
tools/widl/parser.y | 7 +++++++
tools/widl/widltypes.h | 2 ++
4 files changed, 15 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 153437971cc..4db244fef5d 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -185,6 +185,10 @@ const char *get_name(const var_t *v)
{
static char *buffer;
free( buffer );
+ if (is_attr( v->attrs, ATTR_EVENTADD ))
+ return buffer = strmake( "add_%s", v->name );
+ if (is_attr( v->attrs, ATTR_EVENTREMOVE ))
+ return buffer = strmake( "remove_%s", v->name );
if (is_attr( v->attrs, ATTR_PROPGET ))
return buffer = strmake( "get_%s", v->name );
if (is_attr( v->attrs, ATTR_PROPPUT ))
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 6bbfed5e80b..a0b9714dfa0 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -359,6 +359,8 @@ static const struct keyword attr_keywords[] =
{"encode", tENCODE, 0},
{"endpoint", tENDPOINT, 0},
{"entry", tENTRY, 0},
+ {"eventadd", tEVENTADD, 1},
+ {"eventremove", tEVENTREMOVE, 1},
{"exclusiveto", tEXCLUSIVETO, 1},
{"explicit_handle", tEXPLICITHANDLE, 0},
{"fault_status", tFAULTSTATUS, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index d12caa06b63..537b4f332f3 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -197,6 +197,7 @@ static typelib_t *current_typelib;
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
%token tENABLEALLOCATE tENCODE tENDPOINT
%token tENTRY tENUM tERRORSTATUST
+%token tEVENTADD tEVENTREMOVE
%token tEXCLUSIVETO
%token tEXPLICITHANDLE tEXTERN
%token tFALSE
@@ -571,6 +572,8 @@ attribute: { $$ = NULL; }
| tENCODE { $$ = make_attr(ATTR_ENCODE); }
| tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); }
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); }
+ | tEVENTADD { $$ = make_attr(ATTR_EVENTADD); }
+ | tEVENTREMOVE { $$ = make_attr(ATTR_EVENTREMOVE); }
| tEXCLUSIVETO '(' decl_spec ')' { if ($3->type->type_type != TYPE_RUNTIMECLASS)
error_loc("type %s is not a runtimeclass\n", $3->type->name);
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
@@ -2256,6 +2259,8 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EVENTADD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
+ /* ATTR_EVENTREMOVE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
@@ -2929,6 +2934,8 @@ static void check_functions(const type_t *iface, int is_inside_library)
{
if (func == func_iter) break;
if (strcmp(func->name, func_iter->name)) continue;
+ if (is_attr(func->attrs, ATTR_EVENTADD) != is_attr(func_iter->attrs, ATTR_EVENTADD)) continue;
+ if (is_attr(func->attrs, ATTR_EVENTREMOVE) != is_attr(func_iter->attrs, ATTR_EVENTREMOVE)) continue;
if (is_attr(func->attrs, ATTR_PROPGET) != is_attr(func_iter->attrs, ATTR_PROPGET)) continue;
if (is_attr(func->attrs, ATTR_PROPPUT) != is_attr(func_iter->attrs, ATTR_PROPPUT)) continue;
if (is_attr(func->attrs, ATTR_PROPPUTREF) != is_attr(func_iter->attrs, ATTR_PROPPUTREF)) continue;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 46a44dac039..51d325ce930 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -103,6 +103,8 @@ enum attr_type
ATTR_ENCODE,
ATTR_ENDPOINT,
ATTR_ENTRY,
+ ATTR_EVENTADD,
+ ATTR_EVENTREMOVE,
ATTR_EXCLUSIVETO,
ATTR_EXPLICIT_HANDLE,
ATTR_FAULTSTATUS,
--
2.29.2

View File

@ -1,66 +0,0 @@
From 837aa860559609889bd9dbf189960a3dca021ce5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 18:02:59 +0200
Subject: [PATCH] widl: Support WinRT flags attribute parsing.
---
tools/widl/parser.l | 1 +
tools/widl/parser.y | 3 +++
tools/widl/widltypes.h | 1 +
3 files changed, 5 insertions(+)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index a0b9714dfa0..7e20d30e7f0 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -364,6 +364,7 @@ static const struct keyword attr_keywords[] =
{"exclusiveto", tEXCLUSIVETO, 1},
{"explicit_handle", tEXPLICITHANDLE, 0},
{"fault_status", tFAULTSTATUS, 0},
+ {"flags", tFLAGS, 1},
{"force_allocate", tFORCEALLOCATE, 0},
{"free", tFREE, 0},
{"handle", tHANDLE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 537b4f332f3..480552e3723 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -202,6 +202,7 @@ static typelib_t *current_typelib;
%token tEXPLICITHANDLE tEXTERN
%token tFALSE
%token tFASTCALL tFAULTSTATUS
+%token tFLAGS
%token tFLOAT tFORCEALLOCATE
%token tHANDLE
%token tHANDLET
@@ -579,6 +580,7 @@ attribute: { $$ = NULL; }
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
| tEXPLICITHANDLE { $$ = make_attr(ATTR_EXPLICIT_HANDLE); }
| tFAULTSTATUS { $$ = make_attr(ATTR_FAULTSTATUS); }
+ | tFLAGS { $$ = make_attr(ATTR_FLAGS); }
| tFORCEALLOCATE { $$ = make_attr(ATTR_FORCEALLOCATE); }
| tHANDLE { $$ = make_attr(ATTR_HANDLE); }
| tHELPCONTEXT '(' expr_int_const ')' { $$ = make_attrp(ATTR_HELPCONTEXT, $3); }
@@ -2264,6 +2266,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
+ /* ATTR_FLAGS */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "flags" },
/* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
/* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
/* ATTR_HELPCONTEXT */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpcontext" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 51d325ce930..0fba33d6a09 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -108,6 +108,7 @@ enum attr_type
ATTR_EXCLUSIVETO,
ATTR_EXPLICIT_HANDLE,
ATTR_FAULTSTATUS,
+ ATTR_FLAGS,
ATTR_FORCEALLOCATE,
ATTR_HANDLE,
ATTR_HELPCONTEXT,
--
2.29.2

View File

@ -1 +1 @@
47ac628b4a4e476c1b044765c95d5be2a7101d14
cfbbde2abce1eedc7f53db3f8af8078fe4a11cac