mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 3fc1180623b9a0c9fc9e16abf358b179f2eff49b
This commit is contained in:
parent
27ff0169ed
commit
7cbbfd0a9e
@ -1,25 +1,24 @@
|
||||
From 3ff546b9cbde1d0f5ea43c5cbb92ac8dc2028676 Mon Sep 17 00:00:00 2001
|
||||
From dd6544561d6432555f14a9004e107e6b87564949 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:55 +0200
|
||||
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/loader.c | 40 ++++++++++++++++++++++++++++++++++++++--
|
||||
server/process.c | 8 ++++++++
|
||||
server/process.h | 1 +
|
||||
server/protocol.def | 7 +++++++
|
||||
server/token.c | 14 ++++++++++++++
|
||||
5 files changed, 67 insertions(+)
|
||||
5 files changed, 68 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 3fcbbf77a5..2399f1246e 100644
|
||||
index d7dbe57..7588d5a 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3054,6 +3054,32 @@ NTSTATUS attach_dlls( CONTEXT *context )
|
||||
}
|
||||
@@ -3321,6 +3321,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
|
||||
|
||||
+/***********************************************************************
|
||||
/***********************************************************************
|
||||
+ * elevate_process
|
||||
+ */
|
||||
+static void elevate_process( void )
|
||||
@ -45,19 +44,37 @@ index 3fcbbf77a5..2399f1246e 100644
|
||||
+}
|
||||
+
|
||||
+
|
||||
/***********************************************************************
|
||||
+/***********************************************************************
|
||||
* load_global_options
|
||||
*/
|
||||
@@ -3115,6 +3141,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
ULONG_PTR unknown3, ULONG_PTR unknown4 )
|
||||
static void load_global_options(void)
|
||||
@@ -3373,6 +3399,7 @@ static void load_global_options(void)
|
||||
}
|
||||
|
||||
|
||||
+
|
||||
/***********************************************************************
|
||||
* RtlImageDirectoryEntryToData (NTDLL.@)
|
||||
*/
|
||||
@@ -3408,7 +3435,6 @@ PVOID WINAPI RtlImageDirectoryEntryToData( HMODULE module, BOOL image, WORD dir,
|
||||
return RtlImageRvaToVa( nt, module, addr, NULL );
|
||||
}
|
||||
|
||||
-
|
||||
/***********************************************************************
|
||||
* RtlImageRvaToSection (NTDLL.@)
|
||||
*/
|
||||
@@ -3505,7 +3531,7 @@ void __wine_process_init(void)
|
||||
{
|
||||
static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
||||
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
|
||||
-
|
||||
+ ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
|
||||
NTSTATUS status;
|
||||
WINE_MODREF *wm;
|
||||
PEB *peb = NtCurrentTeb()->Peb;
|
||||
@@ -3142,6 +3169,16 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
REG_DWORD, &peb->NtGlobalFlag, sizeof(peb->NtGlobalFlag), NULL );
|
||||
NTSTATUS status;
|
||||
ANSI_STRING func_name;
|
||||
@@ -3556,6 +3582,16 @@ void __wine_process_init(void)
|
||||
&NtCurrentTeb()->Peb->NtGlobalFlag, sizeof(DWORD), NULL );
|
||||
heap_set_debug_flags( GetProcessHeap() );
|
||||
|
||||
+ /* elevate process if necessary */
|
||||
@ -72,12 +89,12 @@ index 3fcbbf77a5..2399f1246e 100644
|
||||
+
|
||||
/* the main exe needs to be the first in the load order list */
|
||||
RemoveEntryList( &wm->ldr.InLoadOrderModuleList );
|
||||
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList );
|
||||
InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList );
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index ee85249bd4..81cea2f1ba 100644
|
||||
index 0a25f44..3988b52 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1133,6 +1133,14 @@ struct process_snapshot *process_snap( int *count )
|
||||
@@ -1109,6 +1109,14 @@ struct process_snapshot *process_snap( int *count )
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
@ -93,10 +110,10 @@ index ee85249bd4..81cea2f1ba 100644
|
||||
DECL_HANDLER(new_process)
|
||||
{
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index f22c128f07..78e88ec350 100644
|
||||
index 4566a04..029b328 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -136,6 +136,7 @@ extern void break_process( struct process *process );
|
||||
@@ -138,6 +138,7 @@ extern void break_process( struct process *process );
|
||||
extern void detach_debugged_processes( struct thread *debugger );
|
||||
extern struct process_snapshot *process_snap( int *count );
|
||||
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
|
||||
@ -105,10 +122,10 @@ index f22c128f07..78e88ec350 100644
|
||||
/* console functions */
|
||||
extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 0abd1683f0..5fb6e38ea5 100644
|
||||
index 071f740..cc44503 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3654,6 +3654,13 @@ struct handle_info
|
||||
@@ -3674,6 +3674,13 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@ -123,10 +140,10 @@ index 0abd1683f0..5fb6e38ea5 100644
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 64ab565a95..52fa10d52e 100644
|
||||
index e449e61..961fbe7 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -1802,3 +1802,17 @@ DECL_HANDLER(create_token)
|
||||
@@ -1797,3 +1797,17 @@ DECL_HANDLER(create_token)
|
||||
release_object( token );
|
||||
}
|
||||
}
|
||||
@ -145,5 +162,5 @@ index 64ab565a95..52fa10d52e 100644
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.16.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 33e1022c63ace91f96c3e1376412bcb17a3a4289 Mon Sep 17 00:00:00 2001
|
||||
From 0c8487ff0c2b10bae391672c5876bfcc5987f7de Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 3 Apr 2017 05:30:27 +0200
|
||||
Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
|
||||
|
||||
---
|
||||
dlls/kernel32/tests/loader.c | 76 ++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/loader.c | 65 ++++++++++++++++++++++++++++++
|
||||
include/winternl.h | 6 ++-
|
||||
dlls/kernel32/tests/loader.c | 76 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/loader.c | 65 +++++++++++++++++++++++++++++++++++++
|
||||
include/winternl.h | 6 ++--
|
||||
3 files changed, 145 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
|
||||
index 165c05ea..d26b7879 100644
|
||||
index b497ce3..c54eade 100644
|
||||
--- a/dlls/kernel32/tests/loader.c
|
||||
+++ b/dlls/kernel32/tests/loader.c
|
||||
@@ -30,6 +30,7 @@
|
||||
@ -21,7 +21,7 @@ index 165c05ea..d26b7879 100644
|
||||
#include "wine/test.h"
|
||||
#include "delayloadhandler.h"
|
||||
|
||||
@@ -3806,6 +3807,79 @@ static void test_InMemoryOrderModuleList(void)
|
||||
@@ -3842,6 +3843,79 @@ static void test_InMemoryOrderModuleList(void)
|
||||
ok(entry2 == mark2, "expected entry2 == mark2, got %p and %p\n", entry2, mark2);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ index 165c05ea..d26b7879 100644
|
||||
START_TEST(loader)
|
||||
{
|
||||
int argc;
|
||||
@@ -3872,6 +3946,8 @@ START_TEST(loader)
|
||||
@@ -3908,6 +3982,8 @@ START_TEST(loader)
|
||||
test_import_resolution();
|
||||
test_ExitProcess();
|
||||
test_InMemoryOrderModuleList();
|
||||
@ -111,10 +111,10 @@ index 165c05ea..d26b7879 100644
|
||||
test_Loader();
|
||||
}
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index e7a9c2ca..83b95fa9 100644
|
||||
index 0546478..381c13a 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -93,6 +93,9 @@ static const char * const reason_names[] =
|
||||
@@ -96,6 +96,9 @@ static const char * const reason_names[] =
|
||||
|
||||
static const WCHAR dllW[] = {'.','d','l','l',0};
|
||||
|
||||
@ -124,11 +124,10 @@ index e7a9c2ca..83b95fa9 100644
|
||||
/* internal representation of 32bit modules. per process. */
|
||||
typedef struct _wine_modref
|
||||
{
|
||||
@@ -375,6 +378,52 @@ static void call_ldr_notifications( ULONG reason, LDR_MODULE *module )
|
||||
}
|
||||
@@ -379,6 +382,52 @@ static void call_ldr_notifications( ULONG reason, LDR_MODULE *module )
|
||||
}
|
||||
|
||||
+/*************************************************************************
|
||||
/*************************************************************************
|
||||
+ * hash_basename
|
||||
+ *
|
||||
+ * Calculates the bucket index of a dll using the basename.
|
||||
@ -174,10 +173,11 @@ index e7a9c2ca..83b95fa9 100644
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/*************************************************************************
|
||||
+/*************************************************************************
|
||||
* get_modref
|
||||
*
|
||||
@@ -1099,7 +1148,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
* Looks for the referenced HMODULE in the current process
|
||||
@@ -1102,7 +1151,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
&wm->ldr.InLoadOrderModuleList);
|
||||
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
|
||||
&wm->ldr.InMemoryOrderModuleList);
|
||||
@ -190,7 +190,7 @@ index e7a9c2ca..83b95fa9 100644
|
||||
|
||||
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
|
||||
{
|
||||
@@ -1776,6 +1830,7 @@ static void load_builtin_callback( void *module, const char *filename )
|
||||
@@ -1846,6 +1900,7 @@ static void load_builtin_callback( void *module, const char *filename )
|
||||
/* the module has only be inserted in the load & memory order lists */
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderModuleList);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderModuleList);
|
||||
@ -198,7 +198,7 @@ index e7a9c2ca..83b95fa9 100644
|
||||
/* FIXME: free the modref */
|
||||
builtin_load_info->status = STATUS_DLL_NOT_FOUND;
|
||||
return;
|
||||
@@ -2089,6 +2144,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam
|
||||
@@ -2130,6 +2185,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam
|
||||
/* the module has only be inserted in the load & memory order lists */
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderModuleList);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderModuleList);
|
||||
@ -206,7 +206,7 @@ index e7a9c2ca..83b95fa9 100644
|
||||
|
||||
/* FIXME: there are several more dangling references
|
||||
* left. Including dlls loaded by this dll before the
|
||||
@@ -3089,6 +3145,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
@@ -3180,6 +3236,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
{
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderModuleList);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderModuleList);
|
||||
@ -214,25 +214,15 @@ index e7a9c2ca..83b95fa9 100644
|
||||
if (wm->ldr.InInitializationOrderModuleList.Flink)
|
||||
RemoveEntryList(&wm->ldr.InInitializationOrderModuleList);
|
||||
|
||||
@@ -3416,6 +3473,9 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
RemoveEntryList( &wm->ldr.InMemoryOrderModuleList );
|
||||
InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderModuleList );
|
||||
|
||||
+ /* the windows version was not set yet when ntdll and kernel32 were loaded */
|
||||
+ recompute_hash_map();
|
||||
+
|
||||
if ((status = virtual_alloc_thread_stack( NtCurrentTeb(), 0, 0, NULL )) != STATUS_SUCCESS)
|
||||
{
|
||||
ERR( "Main exe initialization for %s failed, status %x\n",
|
||||
@@ -3563,6 +3623,7 @@ void __wine_process_init(void)
|
||||
@@ -3660,6 +3717,7 @@ void __wine_process_init(void)
|
||||
ANSI_STRING func_name;
|
||||
UNICODE_STRING nt_name;
|
||||
void (* DECLSPEC_NORETURN CDECL init_func)(void);
|
||||
void * (CDECL *init_func)(void);
|
||||
+ DWORD i;
|
||||
|
||||
thread_init();
|
||||
|
||||
@@ -3572,6 +3633,10 @@ void __wine_process_init(void)
|
||||
@@ -3669,6 +3727,10 @@ void __wine_process_init(void)
|
||||
|
||||
load_global_options();
|
||||
|
||||
@ -243,11 +233,21 @@ index e7a9c2ca..83b95fa9 100644
|
||||
/* setup the load callback and create ntdll modref */
|
||||
wine_dll_set_callback( load_builtin_callback );
|
||||
|
||||
@@ -3723,6 +3785,9 @@ void __wine_process_init(void)
|
||||
RemoveEntryList( &wm->ldr.InMemoryOrderModuleList );
|
||||
InsertHeadList( &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderModuleList );
|
||||
|
||||
+ /* the windows version was not set yet when ntdll and kernel32 were loaded */
|
||||
+ recompute_hash_map();
|
||||
+
|
||||
if ((status = virtual_alloc_thread_stack( NtCurrentTeb(), 0, 0, NULL )) != STATUS_SUCCESS)
|
||||
{
|
||||
ERR( "Main exe initialization for %s failed, status %x\n",
|
||||
diff --git a/include/winternl.h b/include/winternl.h
|
||||
index 9dfc4407..ee89bc31 100644
|
||||
index 6e75b0b..7ee4b25 100644
|
||||
--- a/include/winternl.h
|
||||
+++ b/include/winternl.h
|
||||
@@ -2198,8 +2198,7 @@ typedef struct _LDR_MODULE
|
||||
@@ -2199,8 +2199,7 @@ typedef struct _LDR_MODULE
|
||||
ULONG Flags;
|
||||
SHORT LoadCount;
|
||||
SHORT TlsIndex;
|
||||
@ -257,7 +257,7 @@ index 9dfc4407..ee89bc31 100644
|
||||
ULONG TimeDateStamp;
|
||||
HANDLE ActivationContext;
|
||||
PVOID PatchInformation;
|
||||
@@ -2209,6 +2208,9 @@ typedef struct _LDR_MODULE
|
||||
@@ -2210,6 +2209,9 @@ typedef struct _LDR_MODULE
|
||||
PVOID ContextInformation;
|
||||
ULONG_PTR OriginalBase;
|
||||
LARGE_INTEGER LoadTime;
|
||||
@ -268,5 +268,5 @@ index 9dfc4407..ee89bc31 100644
|
||||
|
||||
typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 6dce8cc12b18115a486509cc730e6993b9ce56a0 Mon Sep 17 00:00:00 2001
|
||||
From c9e0926469230f97d3cee6bc22b7d27099f1d555 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 30 May 2015 02:23:15 +0200
|
||||
Subject: [PATCH] ntdll: Add support for hiding wine version information from
|
||||
@ -10,7 +10,7 @@ Subject: [PATCH] ntdll: Add support for hiding wine version information from
|
||||
2 files changed, 100 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index cda55e1..71d2659 100644
|
||||
index 7588d5a..8073434 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -68,9 +68,12 @@ typedef void (CALLBACK *LDRENUMPROC)(LDR_MODULE *, void *, BOOLEAN *);
|
||||
@ -132,21 +132,21 @@ index cda55e1..71d2659 100644
|
||||
{
|
||||
*address = proc;
|
||||
ret = STATUS_SUCCESS;
|
||||
@@ -3427,6 +3520,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
peb->LoaderLock = &loader_section;
|
||||
@@ -3576,6 +3669,7 @@ void __wine_process_init(void)
|
||||
NtCurrentTeb()->Peb->LoaderLock = &loader_section;
|
||||
update_user_process_params( &wm->ldr.FullDllName );
|
||||
version_init( wm->ldr.FullDllName.Buffer );
|
||||
+ hidden_exports_init( wm->ldr.FullDllName.Buffer );
|
||||
virtual_set_large_address_space();
|
||||
|
||||
LdrQueryImageFileExecutionOptions( &peb->ProcessParameters->ImagePathName, globalflagW,
|
||||
LdrQueryImageFileExecutionOptions( &wm->ldr.FullDllName, globalflagW, REG_DWORD,
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index e1b2482..dd4c8bc 100644
|
||||
index c21ec79..0dba878 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -259,6 +259,11 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN;
|
||||
|
||||
@@ -260,6 +260,11 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
|
||||
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
|
||||
void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
|
||||
|
||||
+/* version */
|
||||
+extern const char * CDECL NTDLL_wine_get_version(void);
|
||||
|
@ -1,231 +0,0 @@
|
||||
From 4a15b14e372df3acfe0fdf50554ec60fc8d77774 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Fri, 27 Jul 2018 01:08:43 -0500
|
||||
Subject: [PATCH] ntdll: Refactor LdrInitializeThunk.
|
||||
|
||||
Since LdrInitializeThunk is exported by ntdll, its semantics may be relied on
|
||||
by programs. At least one program expects that it is called whenever a new
|
||||
thread is created and that the first argument is the CONTEXT for the thread.
|
||||
Furthermore, it is expected that on i386 Eax will contain the thread's entry
|
||||
point.
|
||||
---
|
||||
dlls/kernel32/process.c | 4 +++-
|
||||
dlls/ntdll/loader.c | 22 +++++++++-------------
|
||||
dlls/ntdll/ntdll.spec | 3 +++
|
||||
dlls/ntdll/ntdll_misc.h | 1 -
|
||||
dlls/ntdll/signal_arm.c | 2 +-
|
||||
dlls/ntdll/signal_arm64.c | 2 +-
|
||||
dlls/ntdll/signal_i386.c | 2 +-
|
||||
dlls/ntdll/signal_powerpc.c | 2 +-
|
||||
dlls/ntdll/signal_x86_64.c | 2 +-
|
||||
dlls/ntdll/thread.c | 4 ++--
|
||||
include/winternl.h | 2 +-
|
||||
11 files changed, 23 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
|
||||
index 1b5c670..42dd7cb 100644
|
||||
--- a/dlls/kernel32/process.c
|
||||
+++ b/dlls/kernel32/process.c
|
||||
@@ -74,6 +74,8 @@ extern char **__wine_main_environ;
|
||||
static char **__wine_get_main_environment(void) { return __wine_main_environ; }
|
||||
#endif
|
||||
|
||||
+extern void __wine_ldr_start_process(void *kernel_start);
|
||||
+
|
||||
typedef struct
|
||||
{
|
||||
LPSTR lpEnvAddress;
|
||||
@@ -1326,7 +1328,7 @@ void CDECL __wine_kernel_init(void)
|
||||
|
||||
if (!params->CurrentDirectory.Handle) chdir("/"); /* avoid locking removable devices */
|
||||
|
||||
- LdrInitializeThunk( start_process_wrapper, 0, 0, 0 );
|
||||
+ __wine_ldr_start_process( start_process_wrapper );
|
||||
|
||||
error:
|
||||
ExitProcess( GetLastError() );
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 09e5259..7d3720d 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3521,21 +3521,22 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
|
||||
}
|
||||
|
||||
|
||||
-/***********************************************************************
|
||||
- * attach_dlls
|
||||
+/******************************************************************
|
||||
+ * LdrInitializeThunk (NTDLL.@)
|
||||
*
|
||||
- * Attach to all the loaded dlls.
|
||||
- * If this is the first time, perform the full process initialization.
|
||||
*/
|
||||
-NTSTATUS attach_dlls( CONTEXT *context, void **entry )
|
||||
+void WINAPI LdrInitializeThunk( PCONTEXT context, ULONG_PTR unknown2,
|
||||
+ ULONG_PTR unknown3, ULONG_PTR unknown4 )
|
||||
{
|
||||
NTSTATUS status;
|
||||
WINE_MODREF *wm;
|
||||
LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
|
||||
+ /* For convenience, we use unknown2 to pass a pointer to the entrypoint. */
|
||||
+ void **entry = (void **)unknown2;
|
||||
|
||||
pthread_sigmask( SIG_UNBLOCK, &server_block_set, NULL );
|
||||
|
||||
- if (process_detaching) return STATUS_SUCCESS;
|
||||
+ if (process_detaching) return;
|
||||
|
||||
RtlEnterCriticalSection( &loader_section );
|
||||
|
||||
@@ -3591,7 +3592,7 @@ NTSTATUS attach_dlls( CONTEXT *context, void **entry )
|
||||
}
|
||||
|
||||
RtlLeaveCriticalSection( &loader_section );
|
||||
- return STATUS_SUCCESS;
|
||||
+ return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3704,12 +3705,7 @@ static void user_shared_data_init(void)
|
||||
}
|
||||
|
||||
|
||||
-/******************************************************************
|
||||
- * LdrInitializeThunk (NTDLL.@)
|
||||
- *
|
||||
- */
|
||||
-void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
- ULONG_PTR unknown3, ULONG_PTR unknown4 )
|
||||
+void __wine_ldr_start_process( void *kernel_start )
|
||||
{
|
||||
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
|
||||
ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index b2551ca..0da51e0 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1491,6 +1491,9 @@
|
||||
@ cdecl wine_server_send_fd(long)
|
||||
@ cdecl __wine_make_process_system()
|
||||
|
||||
+# Loader
|
||||
+@ cdecl __wine_ldr_start_process(ptr)
|
||||
+
|
||||
# Virtual memory
|
||||
@ cdecl __wine_locked_recvmsg(long ptr long)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 8fa86b7..aeab3d4 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -110,7 +110,6 @@ extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr )
|
||||
|
||||
/* module handling */
|
||||
extern LIST_ENTRY tls_links DECLSPEC_HIDDEN;
|
||||
-extern NTSTATUS attach_dlls( CONTEXT *context, void **entry ) DECLSPEC_HIDDEN;
|
||||
extern FARPROC RELAY_GetProcAddress( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
|
||||
DWORD exp_size, FARPROC proc, DWORD ordinal, const WCHAR *user ) DECLSPEC_HIDDEN;
|
||||
extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,
|
||||
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c
|
||||
index 5e35907..397a7c6 100644
|
||||
--- a/dlls/ntdll/signal_arm.c
|
||||
+++ b/dlls/ntdll/signal_arm.c
|
||||
@@ -1301,7 +1301,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg,
|
||||
init_thread_context( ctx, entry, arg, relay );
|
||||
}
|
||||
ctx->ContextFlags = CONTEXT_FULL;
|
||||
- attach_dlls( ctx, (void **)&ctx->R0 );
|
||||
+ LdrInitializeThunk( ctx, (ULONG_PTR *)&ctx->R0, 0, 0 );
|
||||
return ctx;
|
||||
}
|
||||
|
||||
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c
|
||||
index 55a7110..893e1eb 100644
|
||||
--- a/dlls/ntdll/signal_arm64.c
|
||||
+++ b/dlls/ntdll/signal_arm64.c
|
||||
@@ -1032,7 +1032,7 @@ static void thread_startup( void *param )
|
||||
context.Pc = (DWORD_PTR)info->start;
|
||||
|
||||
if (info->suspend) wait_suspend( &context );
|
||||
- attach_dlls( &context, (void **)&context.u.s.X0 );
|
||||
+ LdrInitializeThunk( &context, (ULONG_PTR *)&context.u.s.X0, 0, 0 );
|
||||
|
||||
((thread_start_func)context.Pc)( (LPTHREAD_START_ROUTINE)context.u.s.X0, (void *)context.u.s.X1 );
|
||||
}
|
||||
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
|
||||
index b2f7d22..e25fadd 100644
|
||||
--- a/dlls/ntdll/signal_i386.c
|
||||
+++ b/dlls/ntdll/signal_i386.c
|
||||
@@ -2719,7 +2719,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg,
|
||||
init_thread_context( ctx, entry, arg, relay );
|
||||
}
|
||||
ctx->ContextFlags = CONTEXT_FULL;
|
||||
- attach_dlls( ctx, (void **)&ctx->Eax );
|
||||
+ LdrInitializeThunk( ctx, (ULONG_PTR)&ctx->Eax, 0, 0 );
|
||||
return ctx;
|
||||
}
|
||||
|
||||
diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c
|
||||
index f88beec..2fb6820 100644
|
||||
--- a/dlls/ntdll/signal_powerpc.c
|
||||
+++ b/dlls/ntdll/signal_powerpc.c
|
||||
@@ -1194,7 +1194,7 @@ static void thread_startup( void *param )
|
||||
context.Iar = (DWORD)info->start;
|
||||
|
||||
if (info->suspend) wait_suspend( &context );
|
||||
- attach_dlls( &context, (void **)&context.Gpr3 );
|
||||
+ LdrInitializeThunk( &context, (ULONG_PTR *)&context.Gpr3, 0, 0 );
|
||||
|
||||
((thread_start_func)context.Iar)( (LPTHREAD_START_ROUTINE)context.Gpr3, (void *)context.Gpr4 );
|
||||
}
|
||||
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
|
||||
index e751082..269cc92 100644
|
||||
--- a/dlls/ntdll/signal_x86_64.c
|
||||
+++ b/dlls/ntdll/signal_x86_64.c
|
||||
@@ -4474,7 +4474,7 @@ PCONTEXT DECLSPEC_HIDDEN attach_thread( LPTHREAD_START_ROUTINE entry, void *arg,
|
||||
init_thread_context( ctx, entry, arg, relay );
|
||||
}
|
||||
ctx->ContextFlags = CONTEXT_FULL;
|
||||
- attach_dlls( ctx, (void **)&ctx->Rcx );
|
||||
+ LdrInitializeThunk( ctx, (ULONG_PTR)&ctx->Rcx, 0, 0 );
|
||||
return ctx;
|
||||
}
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index f6bb603..eda4fa7 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -67,7 +67,7 @@ void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL;
|
||||
struct startup_info
|
||||
{
|
||||
TEB *teb;
|
||||
- PRTL_THREAD_START_ROUTINE entry_point;
|
||||
+ LPTHREAD_START_ROUTINE entry_point;
|
||||
void *entry_arg;
|
||||
};
|
||||
|
||||
@@ -675,7 +675,7 @@ static void start_thread( struct startup_info *info )
|
||||
|
||||
signal_init_thread( teb );
|
||||
server_init_thread( info->entry_point, &suspend );
|
||||
- signal_start_thread( (LPTHREAD_START_ROUTINE)info->entry_point, info->entry_arg, suspend );
|
||||
+ signal_start_thread( info->entry_point, info->entry_arg, suspend );
|
||||
}
|
||||
|
||||
|
||||
diff --git a/include/winternl.h b/include/winternl.h
|
||||
index 4ea9314..a881480 100644
|
||||
--- a/include/winternl.h
|
||||
+++ b/include/winternl.h
|
||||
@@ -2299,7 +2299,7 @@ NTSYSAPI NTSTATUS WINAPI LdrDisableThreadCalloutsForDll(HMODULE);
|
||||
NTSYSAPI NTSTATUS WINAPI LdrFindEntryForAddress(const void*, PLDR_MODULE*);
|
||||
NTSYSAPI NTSTATUS WINAPI LdrGetDllHandle(LPCWSTR, ULONG, const UNICODE_STRING*, HMODULE*);
|
||||
NTSYSAPI NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE, const ANSI_STRING*, ULONG, void**);
|
||||
-NTSYSAPI void WINAPI LdrInitializeThunk(void*,ULONG_PTR,ULONG_PTR,ULONG_PTR);
|
||||
+NTSYSAPI void WINAPI LdrInitializeThunk(PCONTEXT,ULONG_PTR,ULONG_PTR,ULONG_PTR);
|
||||
NTSYSAPI NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
|
||||
NTSYSAPI NTSTATUS WINAPI LdrLockLoaderLock(ULONG,ULONG*,ULONG_PTR*);
|
||||
IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock(void*,UINT,USHORT*,INT_PTR);
|
||||
--
|
||||
2.7.4
|
||||
|
@ -1,2 +0,0 @@
|
||||
Fixes: [45570] League of Legends 8.12+ fails to start a game (anticheat engine, incorrect implementation of LdrInitializeThunk)
|
||||
Depends: advapi32-Token_Integrity_Level
|
@ -1,2 +1 @@
|
||||
Fixes: [45571] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of NtCreateThread/Ex)
|
||||
Depends: ntdll-LdrInitializeThunk
|
@ -1,19 +1,19 @@
|
||||
From 507f3b20311ceae6a42bde2937d82031594d0b32 Mon Sep 17 00:00:00 2001
|
||||
From 41da6df255dd09494827ad780e5821e119b4507b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 9 Mar 2017 16:27:23 +0100
|
||||
Subject: [PATCH] ntdll: Fill process kernel and user time.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 6 ++-
|
||||
dlls/ntdll/nt.c | 6 +++-
|
||||
dlls/ntdll/ntdll_misc.h | 3 ++
|
||||
dlls/ntdll/thread.c | 84 +++++++++++++++++++++++------------------
|
||||
dlls/ntdll/thread.c | 84 ++++++++++++++++++++++++++++---------------------
|
||||
3 files changed, 56 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index fcc5c635a68..2b5cf5d0ae3 100644
|
||||
index 0db0d16..c370550 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -2452,6 +2452,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
@@ -2451,6 +2451,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
{
|
||||
SYSTEM_PROCESS_INFORMATION* spi = SystemInformation;
|
||||
SYSTEM_PROCESS_INFORMATION* last = NULL;
|
||||
@ -21,7 +21,7 @@ index fcc5c635a68..2b5cf5d0ae3 100644
|
||||
HANDLE hSnap = 0;
|
||||
WCHAR procname[1024];
|
||||
WCHAR* exename;
|
||||
@@ -2489,7 +2490,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
@@ -2488,7 +2489,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
|
||||
if (Length >= len + procstructlen)
|
||||
{
|
||||
@ -30,7 +30,7 @@ index fcc5c635a68..2b5cf5d0ae3 100644
|
||||
* vmCounters, ioCounters
|
||||
*/
|
||||
|
||||
@@ -2507,6 +2508,9 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
@@ -2506,6 +2507,9 @@ NTSTATUS WINAPI NtQuerySystemInformation(
|
||||
|
||||
/* spi->ti will be set later on */
|
||||
|
||||
@ -41,22 +41,22 @@ index fcc5c635a68..2b5cf5d0ae3 100644
|
||||
len += procstructlen;
|
||||
}
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 6b71ded85b1..4a411292cdc 100644
|
||||
index fdc54c6..69005d0 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -258,4 +258,7 @@ extern HANDLE keyed_event DECLSPEC_HIDDEN;
|
||||
|
||||
@@ -260,4 +260,7 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
|
||||
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
|
||||
void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
|
||||
|
||||
+/* process / thread time */
|
||||
+extern BOOL read_process_time(int unix_pid, int unix_tid, unsigned long clk_tck,
|
||||
+ LARGE_INTEGER *kernel, LARGE_INTEGER *user) DECLSPEC_HIDDEN;
|
||||
#endif
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index fe99a804c15..fea1244620c 100644
|
||||
index e4336ab..4279ae7 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -151,6 +151,53 @@ static ULONG_PTR get_image_addr(void)
|
||||
@@ -149,6 +149,53 @@ static ULONG_PTR get_image_addr(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -110,7 +110,7 @@ index fe99a804c15..fea1244620c 100644
|
||||
/***********************************************************************
|
||||
* thread_init
|
||||
*
|
||||
@@ -929,42 +976,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
@@ -908,42 +955,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
#ifdef __linux__
|
||||
/* only /proc provides exact values for a specific thread */
|
||||
if (unix_pid != -1 && unix_tid != -1)
|
||||
@ -155,5 +155,5 @@ index fe99a804c15..fea1244620c 100644
|
||||
|
||||
/* get values for current process instead */
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 3e5ae0f2aec2dfb5d6fd1da07021a6772e8a2135 Mon Sep 17 00:00:00 2001
|
||||
From f3483229e702bed0791a35666237e8583f5d47b0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 5 May 2017 05:40:50 +0200
|
||||
Subject: [PATCH] ntdll: Create thread to update user_shared_data time values
|
||||
@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Create thread to update user_shared_data time values
|
||||
4 files changed, 114 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 71d2659..64aea23 100644
|
||||
index 8073434..0546478 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3493,6 +3493,36 @@ static void load_global_options(void)
|
||||
@@ -3340,6 +3340,36 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@ index 71d2659..64aea23 100644
|
||||
/******************************************************************
|
||||
* LdrInitializeThunk (NTDLL.@)
|
||||
*
|
||||
@@ -3520,6 +3550,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
|
||||
peb->LoaderLock = &loader_section;
|
||||
@@ -3669,6 +3699,7 @@ void __wine_process_init(void)
|
||||
NtCurrentTeb()->Peb->LoaderLock = &loader_section;
|
||||
update_user_process_params( &wm->ldr.FullDllName );
|
||||
version_init( wm->ldr.FullDllName.Buffer );
|
||||
+ user_shared_data_init();
|
||||
@ -61,10 +61,10 @@ index 71d2659..64aea23 100644
|
||||
virtual_set_large_address_space();
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index dd4c8bc..2bf1453 100644
|
||||
index 0dba878..47abfba 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -195,6 +195,9 @@ extern void virtual_set_large_address_space(void) DECLSPEC_HIDDEN;
|
||||
@@ -194,6 +194,9 @@ extern void virtual_set_large_address_space(void) DECLSPEC_HIDDEN;
|
||||
extern void virtual_fill_image_information( const pe_image_info_t *pe_info,
|
||||
SECTION_IMAGE_INFORMATION *info ) DECLSPEC_HIDDEN;
|
||||
extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN;
|
||||
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "7907ccfdcb39b30dc49c96c411332534525b6ea9"
|
||||
echo "3fc1180623b9a0c9fc9e16abf358b179f2eff49b"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -202,7 +202,6 @@ patch_enable_all ()
|
||||
enable_ntdll_Interrupt_0x2e="$1"
|
||||
enable_ntdll_Junction_Points="$1"
|
||||
enable_ntdll_LDR_MODULE="$1"
|
||||
enable_ntdll_LdrInitializeThunk="$1"
|
||||
enable_ntdll_Manifest_Range="$1"
|
||||
enable_ntdll_NtAccessCheck="$1"
|
||||
enable_ntdll_NtContinue="$1"
|
||||
@ -759,9 +758,6 @@ patch_enable ()
|
||||
ntdll-LDR_MODULE)
|
||||
enable_ntdll_LDR_MODULE="$2"
|
||||
;;
|
||||
ntdll-LdrInitializeThunk)
|
||||
enable_ntdll_LdrInitializeThunk="$2"
|
||||
;;
|
||||
ntdll-Manifest_Range)
|
||||
enable_ntdll_Manifest_Range="$2"
|
||||
;;
|
||||
@ -1938,13 +1934,6 @@ if test "$enable_ntdll_WRITECOPY" -eq 1; then
|
||||
enable_ntdll_User_Shared_Data=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_RtlCreateUserThread" -eq 1; then
|
||||
if test "$enable_ntdll_LdrInitializeThunk" -gt 1; then
|
||||
abort "Patchset ntdll-LdrInitializeThunk disabled, but ntdll-RtlCreateUserThread depends on that."
|
||||
fi
|
||||
enable_ntdll_LdrInitializeThunk=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_NtSuspendProcess" -eq 1; then
|
||||
if test "$enable_kernel32_K32GetPerformanceInfo" -gt 1; then
|
||||
abort "Patchset kernel32-K32GetPerformanceInfo disabled, but ntdll-NtSuspendProcess depends on that."
|
||||
@ -1980,13 +1969,6 @@ if test "$enable_winebuild_Fake_Dlls" -eq 1; then
|
||||
enable_ntdll_User_Shared_Data=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_LdrInitializeThunk" -eq 1; then
|
||||
if test "$enable_advapi32_Token_Integrity_Level" -gt 1; then
|
||||
abort "Patchset advapi32-Token_Integrity_Level disabled, but ntdll-LdrInitializeThunk depends on that."
|
||||
fi
|
||||
enable_advapi32_Token_Integrity_Level=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
if test "$enable_ntdll_NtQueryEaFile" -gt 1; then
|
||||
abort "Patchset ntdll-NtQueryEaFile disabled, but ntdll-Junction_Points depends on that."
|
||||
@ -4532,27 +4514,6 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-LdrInitializeThunk
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Staging, advapi32-CreateRestrictedToken, server-Misc_ACL, advapi32-Token_Integrity_Level
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#45570] League of Legends 8.12+ fails to start a game (anticheat engine, incorrect implementation of
|
||||
# | LdrInitializeThunk)
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/process.c, dlls/ntdll/loader.c, dlls/ntdll/ntdll.spec, dlls/ntdll/ntdll_misc.h, dlls/ntdll/signal_arm.c,
|
||||
# | dlls/ntdll/signal_arm64.c, dlls/ntdll/signal_i386.c, dlls/ntdll/signal_powerpc.c, dlls/ntdll/signal_x86_64.c,
|
||||
# | dlls/ntdll/thread.c, include/winternl.h
|
||||
# |
|
||||
if test "$enable_ntdll_LdrInitializeThunk" -eq 1; then
|
||||
patch_apply ntdll-LdrInitializeThunk/0001-ntdll-Refactor-LdrInitializeThunk.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Andrew Wesie", "ntdll: Refactor LdrInitializeThunk.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-Manifest_Range
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -4787,9 +4748,6 @@ fi
|
||||
|
||||
# Patchset ntdll-RtlCreateUserThread
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * Staging, advapi32-CreateRestrictedToken, server-Misc_ACL, advapi32-Token_Integrity_Level, ntdll-LdrInitializeThunk
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#45571] League of Legends 8.12+ fails to start a game (anticheat engine, hooking of NtCreateThread/Ex)
|
||||
# |
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 90f3317910fccc6cf7fc8126fa5d3ff8616df9de Mon Sep 17 00:00:00 2001
|
||||
From 3581c738e28a94fedb1c768b61242b5482f98f60 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 11 May 2017 05:32:55 +0200
|
||||
Subject: winebuild: Generate syscall thunks for ntdll exports.
|
||||
Subject: [PATCH] winebuild: Generate syscall thunks for ntdll exports.
|
||||
|
||||
Based on a patch by Erich E. Hoover.
|
||||
---
|
||||
@ -17,12 +17,12 @@ Based on a patch by Erich E. Hoover.
|
||||
9 files changed, 195 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
|
||||
index 0ad5e1a..9acf8ec 100644
|
||||
index c64cb05..ca91ec1 100644
|
||||
--- a/dlls/ntdll/signal_i386.c
|
||||
+++ b/dlls/ntdll/signal_i386.c
|
||||
@@ -429,6 +429,9 @@ static wine_signal_handler handlers[256];
|
||||
@@ -427,6 +427,9 @@ static size_t signal_stack_size;
|
||||
|
||||
static BOOL fpux_support; /* whether the CPU supports extended fpu context */
|
||||
static wine_signal_handler handlers[256];
|
||||
|
||||
+extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void );
|
||||
+extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context );
|
||||
@ -30,7 +30,7 @@ index 0ad5e1a..9acf8ec 100644
|
||||
enum i386_trap_code
|
||||
{
|
||||
TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */
|
||||
@@ -1404,7 +1407,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi,
|
||||
@@ -1430,7 +1433,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi,
|
||||
{
|
||||
context->Ebp = ebp;
|
||||
context->Esp = (DWORD)&retaddr;
|
||||
@ -39,7 +39,7 @@ index 0ad5e1a..9acf8ec 100644
|
||||
context->SegCs = wine_get_cs();
|
||||
context->SegSs = wine_get_ss();
|
||||
context->EFlags = eflags;
|
||||
@@ -2290,6 +2293,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
|
||||
@@ -2330,6 +2333,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
|
||||
*teb = addr;
|
||||
(*teb)->Tib.Self = &(*teb)->Tib;
|
||||
(*teb)->Tib.ExceptionList = (void *)~0UL;
|
||||
@ -48,10 +48,10 @@ index 0ad5e1a..9acf8ec 100644
|
||||
if (!(thread_data->fs = wine_ldt_alloc_fs()))
|
||||
{
|
||||
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
|
||||
index 5998f54..5925aee 100644
|
||||
index 2f9d642..9bece2a 100644
|
||||
--- a/dlls/ntdll/tests/exception.c
|
||||
+++ b/dlls/ntdll/tests/exception.c
|
||||
@@ -1612,6 +1612,8 @@ static void test_thread_context(void)
|
||||
@@ -1618,6 +1618,8 @@ static void test_thread_context(void)
|
||||
ok( (char *)context.Eip >= (char *)pNtGetContextThread - 0x10000 &&
|
||||
(char *)context.Eip <= (char *)pNtGetContextThread + 0x10000,
|
||||
"wrong Eip %08x/%08x\n", context.Eip, (DWORD)pNtGetContextThread );
|
||||
@ -61,10 +61,10 @@ index 5998f54..5925aee 100644
|
||||
ok( context.SegCs == LOWORD(expect.SegCs), "wrong SegCs %08x/%08x\n", context.SegCs, expect.SegCs );
|
||||
ok( context.SegDs == LOWORD(expect.SegDs), "wrong SegDs %08x/%08x\n", context.SegDs, expect.SegDs );
|
||||
diff --git a/include/winternl.h b/include/winternl.h
|
||||
index f4dd7ca..9cb9a77 100644
|
||||
index 152d596..953c055 100644
|
||||
--- a/include/winternl.h
|
||||
+++ b/include/winternl.h
|
||||
@@ -357,7 +357,7 @@ typedef struct _TEB
|
||||
@@ -358,7 +358,7 @@ typedef struct _TEB
|
||||
PVOID CsrClientThread; /* 03c/0070 */
|
||||
PVOID Win32ThreadInfo; /* 040/0078 */
|
||||
ULONG Win32ClientInfo[31]; /* 044/0080 used for user32 private data in Wine */
|
||||
@ -74,7 +74,7 @@ index f4dd7ca..9cb9a77 100644
|
||||
ULONG FpSoftwareStatusRegister; /* 0c8/010c */
|
||||
PVOID SystemReserved1[54]; /* 0cc/0110 used for krnl386.exe16 private data in Wine */
|
||||
diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h
|
||||
index 90e8e34..df04ef5 100644
|
||||
index fbc2cd9..086ff07 100644
|
||||
--- a/tools/winebuild/build.h
|
||||
+++ b/tools/winebuild/build.h
|
||||
@@ -103,6 +103,7 @@ typedef struct
|
||||
@ -402,10 +402,10 @@ index 3552eca..d851537 100644
|
||||
output_exports( spec );
|
||||
output_imports( spec );
|
||||
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
|
||||
index 6e01f1a..925054b 100644
|
||||
index 95da175..b01d598 100644
|
||||
--- a/tools/winebuild/utils.c
|
||||
+++ b/tools/winebuild/utils.c
|
||||
@@ -792,6 +792,7 @@ void free_dll_spec( DLLSPEC *spec )
|
||||
@@ -794,6 +794,7 @@ void free_dll_spec( DLLSPEC *spec )
|
||||
free( odp->name );
|
||||
free( odp->export_name );
|
||||
free( odp->link_name );
|
||||
@ -413,7 +413,7 @@ index 6e01f1a..925054b 100644
|
||||
}
|
||||
free( spec->file_name );
|
||||
free( spec->dll_name );
|
||||
@@ -801,6 +802,7 @@ void free_dll_spec( DLLSPEC *spec )
|
||||
@@ -803,6 +804,7 @@ void free_dll_spec( DLLSPEC *spec )
|
||||
free( spec->names );
|
||||
free( spec->ordinals );
|
||||
free( spec->resources );
|
||||
@ -421,7 +421,7 @@ index 6e01f1a..925054b 100644
|
||||
free( spec );
|
||||
}
|
||||
|
||||
@@ -1128,3 +1130,22 @@ const char *get_asm_string_section(void)
|
||||
@@ -1130,3 +1132,22 @@ const char *get_asm_string_section(void)
|
||||
default: return ".section .rodata";
|
||||
}
|
||||
}
|
||||
@ -445,5 +445,5 @@ index 6e01f1a..925054b 100644
|
||||
+ return j + 1;
|
||||
+}
|
||||
--
|
||||
2.7.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 087eb0c8e28afd243d5e92d5de09db5446c2d9cb Mon Sep 17 00:00:00 2001
|
||||
From 467f0c1ac0eff47aa0ee1f8b7dd1e1882e6e0eb9 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 8 Aug 2018 20:00:15 -0500
|
||||
Subject: [PATCH 2/2] ntdll: Add a stub implementation of Wow64Transition.
|
||||
Subject: [PATCH] ntdll: Add a stub implementation of Wow64Transition.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 11 ++++++++++-
|
||||
@ -9,10 +9,10 @@ Subject: [PATCH 2/2] ntdll: Add a stub implementation of Wow64Transition.
|
||||
2 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index e7a9c2ca..c1976ef5 100644
|
||||
index 97bcd47..9ad943a 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3550,15 +3550,17 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
||||
@@ -3766,16 +3766,18 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -25,13 +25,14 @@ index e7a9c2ca..c1976ef5 100644
|
||||
{
|
||||
+ static const WCHAR wow64cpuW[] = {'w','o','w','6','4','c','p','u','.','d','l','l',0};
|
||||
static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
||||
|
||||
static const WCHAR globalflagW[] = {'G','l','o','b','a','l','F','l','a','g',0};
|
||||
ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
|
||||
- WINE_MODREF *wm;
|
||||
+ WINE_MODREF *wm, *wow64cpu_wm;
|
||||
NTSTATUS status;
|
||||
ANSI_STRING func_name;
|
||||
UNICODE_STRING nt_name;
|
||||
@@ -3581,6 +3583,13 @@ void __wine_process_init(void)
|
||||
@@ -3803,6 +3805,13 @@ void __wine_process_init(void)
|
||||
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
|
||||
exit(1);
|
||||
}
|
||||
@ -46,7 +47,7 @@ index e7a9c2ca..c1976ef5 100644
|
||||
if ((status = LdrGetProcedureAddress( wm->ldr.BaseAddress, &func_name,
|
||||
0, (void **)&init_func )) != STATUS_SUCCESS)
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 649774f4..b584d962 100644
|
||||
index 5af02ab..b5765dc 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1048,6 +1048,7 @@
|
||||
@ -58,5 +59,5 @@ index 649774f4..b584d962 100644
|
||||
@ stdcall -private ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck
|
||||
@ stdcall -private ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm
|
||||
--
|
||||
2.20.1
|
||||
1.9.1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user