Rebase against 8268c47462544baf5bc7e5071c0a9f2d00c5c2cb.

This commit is contained in:
Zebediah Figura 2019-04-03 17:22:20 -05:00
parent 8b930aea2f
commit 8ce5fe8929
6 changed files with 32 additions and 172 deletions

View File

@ -1,36 +0,0 @@
From 22a49dfa50cda9b1f5a5c64eabed2d17b0033896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 4 Aug 2017 02:52:50 +0200
Subject: server: Correctly validate SID length in sd_is_valid.
---
server/token.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/server/token.c b/server/token.c
index acd7a4dedb5..7ab0f634c05 100644
--- a/server/token.c
+++ b/server/token.c
@@ -332,8 +332,7 @@ int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
owner = sd_get_owner( sd );
if (owner)
{
- size_t needed_size = security_sid_len( owner );
- if ((sd->owner_len < sizeof(SID)) || (needed_size > sd->owner_len))
+ if ((sd->owner_len < sizeof(SID)) || (security_sid_len( owner ) > sd->owner_len))
return FALSE;
}
offset += sd->owner_len;
@@ -344,8 +343,7 @@ int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
group = sd_get_group( sd );
if (group)
{
- size_t needed_size = security_sid_len( group );
- if ((sd->group_len < sizeof(SID)) || (needed_size > sd->group_len))
+ if ((sd->group_len < sizeof(SID)) || (security_sid_len( group ) > sd->group_len))
return FALSE;
}
offset += sd->group_len;
--
2.13.1

View File

@ -1,82 +0,0 @@
From 62a15b6751bab986915164ce9792c662820022b6 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 2 Oct 2015 01:11:54 +0200
Subject: dinput: Do not wait for hook thread startup in
IDirectInput8::Initialize.
---
dlls/dinput/dinput_main.c | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
index 18840b2..49ad447 100644
--- a/dlls/dinput/dinput_main.c
+++ b/dlls/dinput/dinput_main.c
@@ -1483,7 +1483,7 @@ static DWORD WINAPI hook_thread_proc(void *param)
/* Force creation of the message queue */
PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE );
- SetEvent(*(LPHANDLE)param);
+ SetEvent(param);
while (GetMessageW( &msg, 0, 0, 0 ))
{
@@ -1551,6 +1551,7 @@ static DWORD WINAPI hook_thread_proc(void *param)
}
static DWORD hook_thread_id;
+static HANDLE hook_thread_event;
static CRITICAL_SECTION_DEBUG dinput_critsect_debug =
{
@@ -1569,24 +1570,21 @@ static BOOL check_hook_thread(void)
TRACE("IDirectInputs left: %d\n", list_count(&direct_input_list));
if (!list_empty(&direct_input_list) && !hook_thread)
{
- HANDLE event;
-
- event = CreateEventW(NULL, FALSE, FALSE, NULL);
- hook_thread = CreateThread(NULL, 0, hook_thread_proc, &event, 0, &hook_thread_id);
- if (event && hook_thread)
- {
- HANDLE handles[2];
- handles[0] = event;
- handles[1] = hook_thread;
- WaitForMultipleObjects(2, handles, FALSE, INFINITE);
- }
+ hook_thread_event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ hook_thread = CreateThread(NULL, 0, hook_thread_proc, hook_thread_event, 0, &hook_thread_id);
LeaveCriticalSection(&dinput_hook_crit);
- CloseHandle(event);
}
else if (list_empty(&direct_input_list) && hook_thread)
{
DWORD tid = hook_thread_id;
+ if (hook_thread_event) /* if thread is not started yet */
+ {
+ WaitForSingleObject(hook_thread_event, INFINITE);
+ CloseHandle(hook_thread_event);
+ hook_thread_event = NULL;
+ }
+
hook_thread_id = 0;
PostThreadMessageW(tid, WM_USER+0x10, 0, 0);
LeaveCriticalSection(&dinput_hook_crit);
@@ -1627,6 +1625,13 @@ void check_dinput_hooks(LPDIRECTINPUTDEVICE8W iface)
callwndproc_hook = NULL;
}
+ if (hook_thread_event) /* if thread is not started yet */
+ {
+ WaitForSingleObject(hook_thread_event, INFINITE);
+ CloseHandle(hook_thread_event);
+ hook_thread_event = NULL;
+ }
+
PostThreadMessageW( hook_thread_id, WM_USER+0x10, 1, 0 );
LeaveCriticalSection(&dinput_hook_crit);
--
2.5.1

View File

@ -1 +0,0 @@
Fixes: [21403] Do not wait for hook thread startup in IDirectInput8::Initialize

View File

@ -1,4 +1,4 @@
From 4fbcbb1132148919be8175a0e55dda206ee407a2 Mon Sep 17 00:00:00 2001
From 9c098c43e76a736bc84c0f29ca6845eccfee8aa0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 26 Nov 2014 10:46:09 +0100
Subject: [PATCH] ntdll: Move code to update user shared data into a separate
@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Move code to update user shared data into a separate
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 008abb7..87a6c70 100644
index 292b0f6a9..5f679f509 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1526,3 +1526,6 @@
@@ -1528,3 +1528,6 @@
# Filesystem
@ cdecl wine_nt_to_unix_file_name(ptr ptr long long)
@ cdecl wine_unix_to_nt_file_name(ptr ptr)
@ -21,18 +21,18 @@ index 008abb7..87a6c70 100644
+# User shared data
+@ cdecl __wine_user_shared_data()
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index c36337a6..0a11cfe 100644
index fb53bb9a2..febfcdd84 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -246,7 +246,6 @@ void thread_init(void)
@@ -245,7 +245,6 @@ void thread_init(void)
void *addr;
BOOL suspend;
SIZE_T size, info_size;
- LARGE_INTEGER now;
NTSTATUS status;
struct ntdll_thread_data *thread_data;
static struct debug_info debug_info; /* debug info for initial thread */
@@ -340,7 +339,23 @@ void thread_init(void)
@@ -333,7 +332,23 @@ void thread_init(void)
init_user_process_params( info_size );
@ -57,7 +57,7 @@ index c36337a6..0a11cfe 100644
NtQuerySystemTime( &now );
user_shared_data->SystemTime.LowPart = now.u.LowPart;
user_shared_data->SystemTime.High1Time = user_shared_data->SystemTime.High2Time = now.u.HighPart;
@@ -348,10 +363,7 @@ void thread_init(void)
@@ -341,10 +356,7 @@ void thread_init(void)
user_shared_data->u.TickCount.High2Time = user_shared_data->u.TickCount.High1Time;
user_shared_data->TickCountLowDeprecated = user_shared_data->u.TickCount.LowPart;
user_shared_data->TickCountMultiplier = 1 << 24;
@ -70,5 +70,5 @@ index c36337a6..0a11cfe 100644
--
1.9.1
2.20.1

View File

@ -1,4 +1,4 @@
From 85d2001db2e2eccd57c8ec7d90fc851887110dc3 Mon Sep 17 00:00:00 2001
From 0b50cf88e6437b19809352533c714c4f7fcc66f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 4 Oct 2014 02:53:22 +0200
Subject: [PATCH] ntdll: Setup a temporary signal handler during process
@ -8,17 +8,17 @@ Subject: [PATCH] ntdll: Setup a temporary signal handler during process
dlls/ntdll/ntdll_misc.h | 1 +
dlls/ntdll/signal_arm.c | 6 +++++
dlls/ntdll/signal_arm64.c | 6 +++++
dlls/ntdll/signal_i386.c | 53 +++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/signal_i386.c | 53 +++++++++++++++++++++++++++++++++++++
dlls/ntdll/signal_powerpc.c | 6 +++++
dlls/ntdll/signal_x86_64.c | 6 +++++
dlls/ntdll/thread.c | 1 +
7 files changed, 79 insertions(+)
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 693b212..0c21e8c 100644
index d61263c13..881843fe9 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -67,6 +67,7 @@ extern NTSTATUS signal_alloc_thread( TEB **teb ) DECLSPEC_HIDDEN;
@@ -68,6 +68,7 @@ extern NTSTATUS signal_alloc_thread( TEB **teb ) DECLSPEC_HIDDEN;
extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN;
extern void signal_init_thread( TEB *teb ) DECLSPEC_HIDDEN;
extern void signal_init_process(void) DECLSPEC_HIDDEN;
@ -27,10 +27,10 @@ index 693b212..0c21e8c 100644
extern void signal_start_process( LPTHREAD_START_ROUTINE entry, BOOL suspend ) DECLSPEC_HIDDEN;
extern void DECLSPEC_NORETURN signal_exit_thread( int status ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
index 7fe698c..2f55bd3 100644
index 32205ea39..5c311a135 100644
--- a/dlls/ntdll/signal_arm.c
+++ b/dlls/ntdll/signal_arm.c
@@ -1024,6 +1024,12 @@ void signal_init_process(void)
@@ -1048,6 +1048,12 @@ void signal_init_process(void)
exit(1);
}
@ -44,10 +44,10 @@ index 7fe698c..2f55bd3 100644
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
index c461e88..156ff5d 100644
index 94520c95c..4b97a693a 100644
--- a/dlls/ntdll/signal_arm64.c
+++ b/dlls/ntdll/signal_arm64.c
@@ -883,6 +883,12 @@ void signal_init_thread( TEB *teb )
@@ -927,6 +927,12 @@ void signal_init_thread( TEB *teb )
pthread_setspecific( teb_key, teb );
}
@ -61,13 +61,14 @@ index c461e88..156ff5d 100644
/**********************************************************************
* signal_init_process
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 71eff66..c223757 100644
index 053c87da8..868189743 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -1956,6 +1956,31 @@ static void WINAPI raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *cont
@@ -2029,6 +2029,31 @@ static void WINAPI raise_generic_exception( EXCEPTION_RECORD *rec, CONTEXT *cont
}
/**********************************************************************
+/**********************************************************************
+ * segv_handler_early
+ *
+ * Handler for SIGSEGV and related errors. Used only during the initialization
@ -92,11 +93,10 @@ index 71eff66..c223757 100644
+ }
+}
+
+/**********************************************************************
/**********************************************************************
* segv_handler
*
* Handler for SIGSEGV and related errors.
@@ -2369,6 +2394,34 @@ void signal_init_process(void)
@@ -2443,6 +2468,34 @@ void signal_init_process(void)
exit(1);
}
@ -132,10 +132,10 @@ index 71eff66..c223757 100644
/*******************************************************************
* RtlUnwind (NTDLL.@)
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
index cb5089b..635a07f 100644
index 86398d8f5..7b0895202 100644
--- a/dlls/ntdll/signal_powerpc.c
+++ b/dlls/ntdll/signal_powerpc.c
@@ -1045,6 +1045,12 @@ void signal_init_thread( TEB *teb )
@@ -1068,6 +1068,12 @@ void signal_init_thread( TEB *teb )
pthread_setspecific( teb_key, teb );
}
@ -149,10 +149,10 @@ index cb5089b..635a07f 100644
/**********************************************************************
* signal_init_process
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 3b16426..7730b25 100644
index 21e709887..6256a97e7 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -3228,6 +3228,12 @@ void signal_init_process(void)
@@ -3441,6 +3441,12 @@ void signal_init_process(void)
exit(1);
}
@ -166,11 +166,11 @@ index 3b16426..7730b25 100644
/**********************************************************************
* RtlAddFunctionTable (NTDLL.@)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 1bf44c8..241e7f3 100644
index 40d662a76..1046bc5b1 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -446,6 +446,7 @@ HANDLE thread_init(void)
static struct debug_info debug_info; /* debug info for initial thread */
@@ -252,6 +252,7 @@ void thread_init(void)
struct ntdll_thread_data *thread_data;
virtual_init();
+ signal_init_early();
@ -178,5 +178,5 @@ index 1bf44c8..241e7f3 100644
/* reserve space for shared user data */
--
2.7.4
2.20.1

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "33c35baa6761b00c8cef236c06cb1655f3f228d9"
echo "8268c47462544baf5bc7e5071c0a9f2d00c5c2cb"
}
# Show version information
@ -131,7 +131,6 @@ patch_enable_all ()
enable_ddraw_Write_Vtable="$1"
enable_ddraw_version_check="$1"
enable_dinput_Deadlock="$1"
enable_dinput_Initialize="$1"
enable_dinput_axis_recalc="$1"
enable_dinput_reconnect_joystick="$1"
enable_dinput_remap_joystick="$1"
@ -535,9 +534,6 @@ patch_enable ()
dinput-Deadlock)
enable_dinput_Deadlock="$2"
;;
dinput-Initialize)
enable_dinput_Initialize="$2"
;;
dinput-axis-recalc)
enable_dinput_axis_recalc="$2"
;;
@ -2177,11 +2173,9 @@ fi
if test "$enable_advapi32_CreateRestrictedToken" -eq 1; then
patch_apply advapi32-CreateRestrictedToken/0001-ntdll-Implement-NtFilterToken.patch
patch_apply advapi32-CreateRestrictedToken/0002-advapi32-Implement-CreateRestrictedToken.patch
patch_apply advapi32-CreateRestrictedToken/0003-server-Correctly-validate-SID-length-in-sd_is_valid.patch
(
printf '%s\n' '+ { "Michael Müller", "ntdll: Implement NtFilterToken.", 1 },';
printf '%s\n' '+ { "Michael Müller", "advapi32: Implement CreateRestrictedToken.", 1 },';
printf '%s\n' '+ { "Michael Müller", "server: Correctly validate SID length in sd_is_valid.", 1 },';
) >> "$patchlist"
fi
@ -3158,21 +3152,6 @@ if test "$enable_dinput_Deadlock" -eq 1; then
) >> "$patchlist"
fi
# Patchset dinput-Initialize
# |
# | This patchset fixes the following Wine bugs:
# | * [#21403] Do not wait for hook thread startup in IDirectInput8::Initialize
# |
# | Modified files:
# | * dlls/dinput/dinput_main.c
# |
if test "$enable_dinput_Initialize" -eq 1; then
patch_apply dinput-Initialize/0001-dinput-Do-not-wait-for-hook-thread-startup-in-IDirec.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "dinput: Do not wait for hook thread startup in IDirectInput8::Initialize.", 1 },';
) >> "$patchlist"
fi
# Patchset dinput-axis-recalc
# |
# | This patchset fixes the following Wine bugs: