From ff10ae6e74a8f090f89a217e0ff6da862b6b022b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 27 Aug 2019 08:47:31 +1000 Subject: [PATCH] Rebase against 480bae108c96dfe370feba2680dbefc42ef97571 --- ...when-exception-handling-triggers-sta.patch | 91 -------- ...ack-overflow-exception-earlier-on-x8.patch | 29 --- patches/ntdll-Stack_Overflow/definition | 1 - ...registration-for-the-winebus-service.patch | 18 +- patches/patchinstall.sh | 53 +---- ...-Implement-virtual_map_shared_memory.patch | 12 +- ...-support-for-global-and-local-shared.patch | 54 ++--- ...uild-Add-stub-functions-in-fake-dlls.patch | 62 +++--- .../0001-wuauserv-Add-dummy-service.patch | 194 ------------------ patches/wuauserv-Dummy_Service/definition | 1 - 10 files changed, 74 insertions(+), 441 deletions(-) delete mode 100644 patches/ntdll-Stack_Guard_Page/0001-ntdll-Fix-a-bug-when-exception-handling-triggers-sta.patch delete mode 100644 patches/ntdll-Stack_Overflow/0001-ntdll-Trigger-stack-overflow-exception-earlier-on-x8.patch delete mode 100644 patches/ntdll-Stack_Overflow/definition delete mode 100644 patches/wuauserv-Dummy_Service/0001-wuauserv-Add-dummy-service.patch delete mode 100644 patches/wuauserv-Dummy_Service/definition diff --git a/patches/ntdll-Stack_Guard_Page/0001-ntdll-Fix-a-bug-when-exception-handling-triggers-sta.patch b/patches/ntdll-Stack_Guard_Page/0001-ntdll-Fix-a-bug-when-exception-handling-triggers-sta.patch deleted file mode 100644 index bde153fc..00000000 --- a/patches/ntdll-Stack_Guard_Page/0001-ntdll-Fix-a-bug-when-exception-handling-triggers-sta.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 97e45707bdd1e43bdafd6a63b68b25cd9ca9ce0a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 17 Apr 2016 01:13:45 +0200 -Subject: ntdll: Fix a bug when exception handling triggers stack guard page. - ---- - dlls/ntdll/signal_i386.c | 7 ++----- - dlls/ntdll/signal_x86_64.c | 7 ++----- - 2 files changed, 4 insertions(+), 10 deletions(-) - -diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 59dca6c..d26861d 100644 ---- a/dlls/ntdll/signal_i386.c -+++ b/dlls/ntdll/signal_i386.c -@@ -1764,7 +1764,6 @@ static EXCEPTION_RECORD *setup_exception_record( ucontext_t *sigcontext, void *s - DWORD ebp; - DWORD eip; - } *stack = stack_ptr; -- DWORD exception_code = 0; - - /* stack sanity checks */ - -@@ -1800,8 +1799,7 @@ static EXCEPTION_RECORD *setup_exception_record( ucontext_t *sigcontext, void *s - else if ((char *)(stack - 1) < (char *)NtCurrentTeb()->Tib.StackLimit) - { - /* stack access below stack limit, may be recoverable */ -- if (virtual_handle_stack_fault( stack - 1 )) exception_code = EXCEPTION_STACK_OVERFLOW; -- else -+ if (!virtual_handle_stack_fault( stack - 1 )) - { - UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)(stack - 1); - WINE_ERR( "stack overflow %u bytes in thread %04x eip %08x esp %08x stack %p-%p-%p\n", -@@ -1823,7 +1821,7 @@ static EXCEPTION_RECORD *setup_exception_record( ucontext_t *sigcontext, void *s - stack->context_ptr = &stack->context; - - stack->rec.ExceptionRecord = NULL; -- stack->rec.ExceptionCode = exception_code; -+ stack->rec.ExceptionCode = STATUS_SUCCESS; - stack->rec.ExceptionFlags = EXCEPTION_CONTINUABLE; - stack->rec.ExceptionAddress = (LPVOID)EIP_sig(sigcontext); - stack->rec.NumberParameters = 0; -@@ -2092,7 +2090,6 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) - } - - rec = setup_exception_record( context, stack, fs, gs, raise_segv_exception ); -- if (rec->ExceptionCode == EXCEPTION_STACK_OVERFLOW) return; - - switch(get_trap_code(context)) - { -diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 1cb7170..f488c00 100644 ---- a/dlls/ntdll/signal_x86_64.c -+++ b/dlls/ntdll/signal_x86_64.c -@@ -2091,7 +2091,6 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun - ULONG64 red_zone[16]; - } *stack; - ULONG64 *rsp_ptr; -- DWORD exception_code = 0; - - stack = (struct stack_layout *)(RSP_sig(sigcontext) & ~15); - -@@ -2126,8 +2125,7 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun - else if ((char *)(stack - 1) < (char *)NtCurrentTeb()->Tib.StackLimit) - { - /* stack access below stack limit, may be recoverable */ -- if (virtual_handle_stack_fault( stack - 1 )) exception_code = EXCEPTION_STACK_OVERFLOW; -- else -+ if (!virtual_handle_stack_fault( stack - 1 )) - { - UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)(stack - 1); - ERR( "stack overflow %u bytes in thread %04x eip %016lx esp %016lx stack %p-%p-%p\n", -@@ -2145,7 +2143,7 @@ static EXCEPTION_RECORD *setup_exception( ucontext_t *sigcontext, raise_func fun - VALGRIND_MAKE_WRITABLE(stack, sizeof(*stack)); - #endif - stack->rec.ExceptionRecord = NULL; -- stack->rec.ExceptionCode = exception_code; -+ stack->rec.ExceptionCode = STATUS_SUCCESS; - stack->rec.ExceptionFlags = EXCEPTION_CONTINUABLE; - stack->rec.ExceptionAddress = (void *)RIP_sig(sigcontext); - stack->rec.NumberParameters = 0; -@@ -2662,7 +2660,6 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) - } - - rec = setup_exception( sigcontext, raise_segv_exception ); -- if (rec->ExceptionCode == EXCEPTION_STACK_OVERFLOW) return; - - switch(TRAP_sig(ucontext)) - { --- -2.7.1 - diff --git a/patches/ntdll-Stack_Overflow/0001-ntdll-Trigger-stack-overflow-exception-earlier-on-x8.patch b/patches/ntdll-Stack_Overflow/0001-ntdll-Trigger-stack-overflow-exception-earlier-on-x8.patch deleted file mode 100644 index 7ae36d89..00000000 --- a/patches/ntdll-Stack_Overflow/0001-ntdll-Trigger-stack-overflow-exception-earlier-on-x8.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a679044828d05cd420b1fb4a0dc43fb49da8d665 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 16 Apr 2016 22:29:12 +0200 -Subject: ntdll: Trigger stack overflow exception earlier on x86_64. - -The Cygwin/MSYS2 exception handler seems to exceed one page, -which breaks handling of stack faults. ---- - dlls/ntdll/signal_x86_64.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c -index 94157bb..81d1758 100644 ---- a/dlls/ntdll/signal_x86_64.c -+++ b/dlls/ntdll/signal_x86_64.c -@@ -2600,8 +2600,9 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) - virtual_handle_stack_fault( siginfo->si_addr )) - { - /* check if this was the last guard page */ -- if ((char *)siginfo->si_addr < (char *)NtCurrentTeb()->DeallocationStack + 2*4096) -+ if ((char *)siginfo->si_addr < (char *)NtCurrentTeb()->DeallocationStack + 3*4096) - { -+ virtual_handle_stack_fault( (char *)siginfo->si_addr - 4096 ); - rec = setup_exception( sigcontext, raise_segv_exception ); - rec->ExceptionCode = EXCEPTION_STACK_OVERFLOW; - } --- -2.7.1 - diff --git a/patches/ntdll-Stack_Overflow/definition b/patches/ntdll-Stack_Overflow/definition deleted file mode 100644 index 0099150c..00000000 --- a/patches/ntdll-Stack_Overflow/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: Trigger stack overflow exception earlier on x86_64 diff --git a/patches/ntoskrnl.exe-IoInvalidateDeviceRelations/0028-wine.inf-Remove-registration-for-the-winebus-service.patch b/patches/ntoskrnl.exe-IoInvalidateDeviceRelations/0028-wine.inf-Remove-registration-for-the-winebus-service.patch index 3ab7d5cd..5dc52c10 100644 --- a/patches/ntoskrnl.exe-IoInvalidateDeviceRelations/0028-wine.inf-Remove-registration-for-the-winebus-service.patch +++ b/patches/ntoskrnl.exe-IoInvalidateDeviceRelations/0028-wine.inf-Remove-registration-for-the-winebus-service.patch @@ -1,4 +1,4 @@ -From e2fd31757e447acc266b152cd46d3ea383b01861 Mon Sep 17 00:00:00 2001 +From 0b5b7f54630a4e7e2f3ed0fa82fbad727fbc0a77 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 27 Jun 2019 22:30:15 -0500 Subject: [PATCH] wine.inf: Remove registration for the winebus service. @@ -9,34 +9,34 @@ Signed-off-by: Zebediah Figura 1 file changed, 12 deletions(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in -index 0918c890fb..e686bcf3c6 100644 +index 02e46c5a542..eb6cfbbd705 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in -@@ -130,7 +130,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService +@@ -135,7 +135,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService AddService=Schedule,0,TaskSchedulerService -AddService=WineBus,0,WineBusService AddService=Winmgmt,0,WinmgmtService + AddService=wuauserv,0,wuauService - [DefaultInstall.NT.Services] -@@ -146,7 +145,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService +@@ -153,7 +152,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService AddService=Schedule,0,TaskSchedulerService -AddService=WineBus,0,WineBusService AddService=Winmgmt,0,WinmgmtService + AddService=wuauserv,0,wuauService - [DefaultInstall.ntamd64.Services] -@@ -162,7 +160,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService +@@ -171,7 +169,6 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService AddService=Schedule,0,TaskSchedulerService -AddService=WineBus,0,WineBusService AddService=Winmgmt,0,WinmgmtService + AddService=wuauserv,0,wuauService - [Strings] -@@ -3465,15 +3462,6 @@ ServiceType=32 +@@ -3681,15 +3678,6 @@ ServiceType=32 StartType=3 ErrorControl=1 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 2cdbcc3e..7c9dbaea 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "f238e846e701d2039eceb51f2f6e9d936f8c791c" + echo "480bae108c96dfe370feba2680dbefc42ef97571" } # Show version information @@ -214,8 +214,6 @@ patch_enable_all () enable_ntdll_RtlQueryPackageIdentity="$1" enable_ntdll_Serial_Port_Detection="$1" enable_ntdll_Signal_Handler="$1" - enable_ntdll_Stack_Guard_Page="$1" - enable_ntdll_Stack_Overflow="$1" enable_ntdll_Status_Mapping="$1" enable_ntdll_SystemExtendedProcessInformation="$1" enable_ntdll_SystemInterruptInformation="$1" @@ -372,7 +370,6 @@ patch_enable_all () enable_ws2_32_getaddrinfo="$1" enable_ws2_32_getsockopt="$1" enable_wtsapi32_EnumerateProcesses="$1" - enable_wuauserv_Dummy_Service="$1" enable_wusa_MSU_Package_Installer="$1" } @@ -773,12 +770,6 @@ patch_enable () ntdll-Signal_Handler) enable_ntdll_Signal_Handler="$2" ;; - ntdll-Stack_Guard_Page) - enable_ntdll_Stack_Guard_Page="$2" - ;; - ntdll-Stack_Overflow) - enable_ntdll_Stack_Overflow="$2" - ;; ntdll-Status_Mapping) enable_ntdll_Status_Mapping="$2" ;; @@ -1247,9 +1238,6 @@ patch_enable () wtsapi32-EnumerateProcesses) enable_wtsapi32_EnumerateProcesses="$2" ;; - wuauserv-Dummy_Service) - enable_wuauserv_Dummy_Service="$2" - ;; wusa-MSU_Package_Installer) enable_wusa_MSU_Package_Installer="$2" ;; @@ -5055,30 +5043,6 @@ if test "$enable_ntdll_Signal_Handler" -eq 1; then ) >> "$patchlist" fi -# Patchset ntdll-Stack_Guard_Page -# | -# | Modified files: -# | * dlls/ntdll/signal_i386.c, dlls/ntdll/signal_x86_64.c -# | -if test "$enable_ntdll_Stack_Guard_Page" -eq 1; then - patch_apply ntdll-Stack_Guard_Page/0001-ntdll-Fix-a-bug-when-exception-handling-triggers-sta.patch - ( - printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Fix a bug when exception handling triggers stack guard page.", 1 },'; - ) >> "$patchlist" -fi - -# Patchset ntdll-Stack_Overflow -# | -# | Modified files: -# | * dlls/ntdll/signal_x86_64.c -# | -if test "$enable_ntdll_Stack_Overflow" -eq 1; then - patch_apply ntdll-Stack_Overflow/0001-ntdll-Trigger-stack-overflow-exception-earlier-on-x8.patch - ( - printf '%s\n' '+ { "Sebastian Lackner", "ntdll: Trigger stack overflow exception earlier on x86_64.", 1 },'; - ) >> "$patchlist" -fi - # Patchset ntdll-Status_Mapping # | # | Modified files: @@ -7482,21 +7446,6 @@ if test "$enable_wtsapi32_EnumerateProcesses" -eq 1; then ) >> "$patchlist" fi -# Patchset wuauserv-Dummy_Service -# | -# | This patchset fixes the following Wine bugs: -# | * [#37781] Implement wuauserv dummy service -# | -# | Modified files: -# | * configure.ac, loader/wine.inf.in, programs/wuauserv/Makefile.in, programs/wuauserv/main.c -# | -if test "$enable_wuauserv_Dummy_Service" -eq 1; then - patch_apply wuauserv-Dummy_Service/0001-wuauserv-Add-dummy-service.patch - ( - printf '%s\n' '+ { "Michael Müller", "wuauserv: Add dummy service.", 1 },'; - ) >> "$patchlist" -fi - # Patchset wusa-MSU_Package_Installer # | # | This patchset fixes the following Wine bugs: diff --git a/patches/server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch b/patches/server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch index e3250905..93c3fddc 100644 --- a/patches/server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch +++ b/patches/server-Shared_Memory/0001-ntdll-Implement-virtual_map_shared_memory.patch @@ -1,4 +1,4 @@ -From e6ed449896d3a86681033f1e62e86d1d73060d69 Mon Sep 17 00:00:00 2001 +From 62f19923f26e57889e352933b2ac0384a6b39075 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 18 Mar 2015 23:03:01 +0100 Subject: [PATCH] ntdll: Implement virtual_map_shared_memory. @@ -10,22 +10,22 @@ Preparation for shared memory wineserver communication. 2 files changed, 52 insertions(+) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 314495640e6..24d2a40e7c5 100644 +index 8af5d6f28a0..7bbe23d969b 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -180,6 +180,7 @@ extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) DECLSPEC_H +@@ -179,6 +179,7 @@ extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) DECLSPEC_H extern NTSTATUS virtual_create_builtin_view( void *base ) DECLSPEC_HIDDEN; extern NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_size, SIZE_T commit_size, SIZE_T *pthread_size ) DECLSPEC_HIDDEN; +extern NTSTATUS virtual_map_shared_memory( int fd, PVOID *addr_ptr, ULONG zero_bits, SIZE_T *size_ptr, ULONG protect ) DECLSPEC_HIDDEN; extern void virtual_clear_thread_stack( void *stack_end ) DECLSPEC_HIDDEN; - extern BOOL virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN; + extern int virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN; extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index bab2e422705..cd96d22431d 100644 +index 186d7335bfc..9d284f9d8b5 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c -@@ -3209,6 +3209,57 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p +@@ -3269,6 +3269,57 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p } diff --git a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch index d890556a..b4247628 100644 --- a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch +++ b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch @@ -1,4 +1,4 @@ -From ef01cf56078dbb657885eb57b918f8297570807f Mon Sep 17 00:00:00 2001 +From 02dbd85ade50972fe25bec623ce24d6e65c868ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Mar 2015 01:22:34 +0100 Subject: [PATCH] server: Implement support for global and local shared memory @@ -20,10 +20,10 @@ Subject: [PATCH] server: Implement support for global and local shared memory 12 files changed, 215 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 149b0a66a..b5f091075 100644 +index 7bbe23d969b..3146f3c150b 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -108,6 +108,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o +@@ -116,6 +116,7 @@ extern NTSTATUS alloc_object_attributes( const OBJECT_ATTRIBUTES *attr, struct o extern NTSTATUS validate_open_object_attributes( const OBJECT_ATTRIBUTES *attr ) DECLSPEC_HIDDEN; extern int wait_select_reply( void *cookie ) DECLSPEC_HIDDEN; extern BOOL invoke_apc( const apc_call_t *call, apc_result_t *result, sigset_t *user_sigset ) DECLSPEC_HIDDEN; @@ -32,10 +32,10 @@ index 149b0a66a..b5f091075 100644 /* module handling */ extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 68881afd9..d6de9af26 100644 +index cce51683356..72a8ddb1803 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -994,6 +994,66 @@ done: +@@ -1002,6 +1002,66 @@ done: } @@ -102,7 +102,7 @@ index 68881afd9..d6de9af26 100644 /*********************************************************************** * wine_server_fd_to_handle (NTDLL.@) * -@@ -1531,6 +1591,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend ) +@@ -1539,6 +1599,10 @@ size_t server_init_thread( void *entry_point, BOOL *suspend ) } SERVER_END_REQ; @@ -114,10 +114,10 @@ index 68881afd9..d6de9af26 100644 ntdll_get_thread_data()->wow64_redir = is_wow64; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 8afaba49c..eb213340e 100644 +index 61b1cce4fe1..89f4e190e75 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -315,6 +315,7 @@ void exit_thread( int status ) +@@ -478,6 +478,7 @@ void exit_thread( int status ) void WINAPI RtlExitUserThread( ULONG status ) { static void *prev_teb; @@ -125,7 +125,7 @@ index 8afaba49c..eb213340e 100644 sigset_t sigset; TEB *teb; -@@ -339,6 +340,9 @@ void WINAPI RtlExitUserThread( ULONG status ) +@@ -502,6 +503,9 @@ void WINAPI RtlExitUserThread( ULONG status ) LdrShutdownThread(); RtlFreeThreadActivationContextStack(); @@ -136,7 +136,7 @@ index 8afaba49c..eb213340e 100644 if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) diff --git a/include/wine/server.h b/include/wine/server.h -index d573d1f7a..9889b95aa 100644 +index ac5dcc6f8bc..5a845f424c2 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -120,6 +120,17 @@ static inline void *wine_server_get_ptr( client_ptr_t ptr ) @@ -158,11 +158,11 @@ index d573d1f7a..9889b95aa 100644 /* macros for server requests */ diff --git a/include/winternl.h b/include/winternl.h -index 2b3fb947b..e15238e5e 100644 +index fed48eb3638..4c0021555c3 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -401,7 +401,7 @@ typedef struct _TEB - PVOID Spare4; /* f7c/1750 */ + PVOID ReservedForPerf; /* f7c/1750 */ PVOID ReservedForOle; /* f80/1758 */ ULONG WaitingOnLoaderLock; /* f84/1760 */ - PVOID Reserved5[3]; /* f88/1768 */ @@ -171,10 +171,10 @@ index 2b3fb947b..e15238e5e 100644 #ifdef _WIN64 PVOID DeallocationBStore; /* /1788 */ diff --git a/server/fd.c b/server/fd.c -index 5d80e218b..87d7047a1 100644 +index ac1c3f85a16..575e88a54f4 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -2568,6 +2568,33 @@ DECL_HANDLER(write) +@@ -2634,6 +2634,33 @@ DECL_HANDLER(write) release_object( fd ); } @@ -209,7 +209,7 @@ index 5d80e218b..87d7047a1 100644 DECL_HANDLER(ioctl) { diff --git a/server/file.h b/server/file.h -index 0621b4794..379fc4507 100644 +index 4341ad3b040..da9e6b788c2 100644 --- a/server/file.h +++ b/server/file.h @@ -166,6 +166,14 @@ extern struct object *create_mailslot_device( struct object *root, const struct @@ -228,10 +228,10 @@ index 0621b4794..379fc4507 100644 extern void do_change_notify( int unix_fd ); diff --git a/server/main.c b/server/main.c -index 7aed338e9..f984bfc1e 100644 +index ee8cadde5da..313039a3082 100644 --- a/server/main.c +++ b/server/main.c -@@ -145,6 +145,7 @@ int main( int argc, char *argv[] ) +@@ -147,6 +147,7 @@ int main( int argc, char *argv[] ) init_signals(); init_directories(); init_registry(); @@ -240,7 +240,7 @@ index 7aed338e9..f984bfc1e 100644 return 0; } diff --git a/server/mapping.c b/server/mapping.c -index ddc8be890..f12876339 100644 +index 0728fdc14fc..7b12d2fb1fa 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -29,8 +29,32 @@ @@ -341,7 +341,7 @@ index ddc8be890..f12876339 100644 static int create_temp_file( file_pos_t size ) { diff --git a/server/protocol.def b/server/protocol.def -index b6ad51446..125d34b29 100644 +index d803976ed94..f9370fbabb4 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -69,6 +69,15 @@ struct request_max_size @@ -360,7 +360,7 @@ index b6ad51446..125d34b29 100644 /* debug event data */ typedef union -@@ -1283,6 +1292,12 @@ enum server_fd_type +@@ -1318,6 +1327,12 @@ enum server_fd_type @END @@ -374,10 +374,10 @@ index b6ad51446..125d34b29 100644 @REQ(flush) async_data_t async; /* async I/O parameters */ diff --git a/server/thread.c b/server/thread.c -index 044d73ca9..35fef023a 100644 +index 24ce76717ae..982fd76008b 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -204,6 +204,8 @@ static inline void init_thread_structure( struct thread *thread ) +@@ -202,6 +202,8 @@ static inline void init_thread_structure( struct thread *thread ) thread->desktop_users = 0; thread->token = NULL; thread->exit_poll = NULL; @@ -386,7 +386,7 @@ index 044d73ca9..35fef023a 100644 thread->creation_time = current_time; thread->exit_time = 0; -@@ -339,6 +341,8 @@ static void cleanup_thread( struct thread *thread ) +@@ -337,6 +339,8 @@ static void cleanup_thread( struct thread *thread ) thread->inflight[i].client = thread->inflight[i].server = -1; } } @@ -395,7 +395,7 @@ index 044d73ca9..35fef023a 100644 thread->req_data = NULL; thread->reply_data = NULL; thread->request_fd = NULL; -@@ -347,6 +351,9 @@ static void cleanup_thread( struct thread *thread ) +@@ -345,6 +349,9 @@ static void cleanup_thread( struct thread *thread ) thread->context = NULL; thread->suspend_context = NULL; thread->desktop = 0; @@ -406,10 +406,10 @@ index 044d73ca9..35fef023a 100644 /* destroy a thread when its refcount is 0 */ diff --git a/server/thread.h b/server/thread.h -index 4e7f794c0..00e8b293e 100644 +index 0085204c92e..382b10b5b01 100644 --- a/server/thread.h +++ b/server/thread.h -@@ -91,6 +91,8 @@ struct thread +@@ -89,6 +89,8 @@ struct thread struct token *token; /* security token associated with this thread */ struct list kernel_object; /* list of kernel object pointers */ struct timeout_user *exit_poll; /* poll if the thread/process has exited already */ @@ -419,5 +419,5 @@ index 4e7f794c0..00e8b293e 100644 struct thread_snapshot -- -2.21.0 +2.17.1 diff --git a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch index f78a1218..7a6ccb52 100644 --- a/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch +++ b/patches/winebuild-Fake_Dlls/0005-winebuild-Add-stub-functions-in-fake-dlls.patch @@ -1,7 +1,7 @@ -From 4b84757bba03d22cb225103cc7e52805a8d223f0 Mon Sep 17 00:00:00 2001 +From 1bde7847e392610773a57ee77731ac6d4caf26aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 15 May 2017 16:27:56 +0200 -Subject: winebuild: Add stub functions in fake dlls. +Subject: [PATCH] winebuild: Add stub functions in fake dlls. --- dlls/kernel32/tests/loader.c | 8 +- @@ -13,10 +13,10 @@ Subject: winebuild: Add stub functions in fake dlls. 6 files changed, 255 insertions(+), 15 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 589e9f66..4a35a592 100644 +index 3b87ca4d151..ed5ed28b510 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1550,9 +1550,7 @@ static void test_FakeDLL(void) +@@ -1555,9 +1555,7 @@ static void test_FakeDLL(void) ok(ptr != NULL, "MapViewOfFile failed with error %u\n", GetLastError()); dir = RtlImageDirectoryEntryToData(ptr, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &size); @@ -26,7 +26,7 @@ index 589e9f66..4a35a592 100644 names = RVAToAddr(dir->AddressOfNames, ptr); ordinals = RVAToAddr(dir->AddressOfNameOrdinals, ptr); -@@ -1581,17 +1579,20 @@ todo_wine +@@ -1586,17 +1584,20 @@ todo_wine /* check position in memory */ dll_rva = (DWORD_PTR)dll_func - (DWORD_PTR)module; map_rva = funcs[ordinals[i]]; @@ -47,7 +47,7 @@ index 589e9f66..4a35a592 100644 ok(!memcmp(map_func, dll_func, 0x20), "%s: Function content does not match!\n", func_name); if (!strcmp(func_name, "NtSetEvent")) -@@ -1605,10 +1606,11 @@ todo_wine +@@ -1610,10 +1611,11 @@ todo_wine ok(event != NULL, "CreateEvent failed with error %u\n", GetLastError()); pNtSetEvent(event, 0); ok(WaitForSingleObject(event, 0) == WAIT_OBJECT_0, "Event was not signaled\n"); @@ -61,7 +61,7 @@ index 589e9f66..4a35a592 100644 CloseHandle(map); CloseHandle(file); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 8dfcd0b5..4a4eb047 100644 +index edd11baf11a..1f33e759b77 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -430,6 +430,45 @@ static wine_signal_handler handlers[256]; @@ -110,32 +110,32 @@ index 8dfcd0b5..4a4eb047 100644 enum i386_trap_code { TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */ -@@ -2321,6 +2360,7 @@ NTSTATUS signal_alloc_thread( TEB **teb ) +@@ -2343,6 +2382,7 @@ NTSTATUS signal_alloc_thread( TEB **teb ) (*teb)->Tib.Self = &(*teb)->Tib; (*teb)->Tib.ExceptionList = (void *)~0UL; (*teb)->WOW32Reserved = __wine_syscall_dispatcher; -+ (*teb)->Spare3 = __wine_fakedll_dispatcher; ++ (*teb)->Spare2 = __wine_fakedll_dispatcher; thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2; if (!(thread_data->fs = wine_ldt_alloc_fs())) { diff --git a/include/winternl.h b/include/winternl.h -index 5d128b46..64640f4b 100644 +index b3ad0d361d2..ba1e1a355fd 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -397,7 +397,7 @@ typedef struct _TEB +@@ -396,7 +396,7 @@ typedef struct _TEB + PVOID Instrumentation[16]; /* f2c/16b8 */ PVOID WinSockData; /* f6c/1738 */ ULONG GdiBatchCount; /* f70/1740 */ - ULONG Spare2; /* f74/1744 */ -- PVOID Spare3; /* f78/1748 */ -+ PVOID Spare3; /* f78/1748 used for fakedll thunks */ - PVOID Spare4; /* f7c/1750 */ +- ULONG Spare2; /* f74/1744 */ ++ ULONG Spare2; /* f74/1744 used for fakedll thunks */ + ULONG GuaranteedStackBytes; /* f78/1748 */ + PVOID ReservedForPerf; /* f7c/1750 */ PVOID ReservedForOle; /* f80/1758 */ - ULONG WaitingOnLoaderLock; /* f84/1760 */ diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h -index 56e9af3d..6b12d496 100644 +index e9967874d51..dcfb37e906b 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h -@@ -344,6 +344,7 @@ extern void put_word( unsigned short val ); +@@ -356,6 +356,7 @@ extern void put_word( unsigned short val ); extern void put_dword( unsigned int val ); extern void put_qword( unsigned int val ); extern void put_pword( unsigned int val ); @@ -144,10 +144,10 @@ index 56e9af3d..6b12d496 100644 extern void align_output_rva( unsigned int file_align, unsigned int rva_align ); extern size_t label_pos( const char *name ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index 55587cb6..2f172033 100644 +index e86188f175a..88b3d4b4090 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c -@@ -794,6 +794,163 @@ void BuildSpec32File( DLLSPEC *spec ) +@@ -881,6 +881,163 @@ void output_spec32_file( DLLSPEC *spec ) } @@ -311,7 +311,7 @@ index 55587cb6..2f172033 100644 /******************************************************************* * output_fake_module_pass * -@@ -812,7 +969,7 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -899,7 +1056,7 @@ static void output_fake_module_pass( DLLSPEC *spec ) const unsigned int section_align = page_size; const unsigned int file_align = 0x200; const unsigned int lfanew = (0x40 + sizeof(fakedll_signature) + 15) & ~15; @@ -320,7 +320,7 @@ index 55587cb6..2f172033 100644 put_word( 0x5a4d ); /* e_magic */ put_word( 0x40 ); /* e_cblp */ -@@ -869,7 +1026,7 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -956,7 +1113,7 @@ static void output_fake_module_pass( DLLSPEC *spec ) put_dword( 0 ); /* SizeOfUninitializedData */ put_dword( label_rva("entrypoint") ); /* AddressOfEntryPoint */ put_dword( label_rva("text_start") ); /* BaseOfCode */ @@ -329,7 +329,7 @@ index 55587cb6..2f172033 100644 put_pword( 0x10000000 ); /* ImageBase */ put_dword( section_align ); /* SectionAlignment */ put_dword( file_align ); /* FileAlignment */ -@@ -892,7 +1049,8 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -979,7 +1136,8 @@ static void output_fake_module_pass( DLLSPEC *spec ) put_dword( 0 ); /* LoaderFlags */ put_dword( 16 ); /* NumberOfRvaAndSizes */ @@ -339,7 +339,7 @@ index 55587cb6..2f172033 100644 put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */ if (spec->nb_resources) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */ { -@@ -932,6 +1090,21 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -1019,6 +1177,21 @@ static void output_fake_module_pass( DLLSPEC *spec ) put_word( 0 ); /* NumberOfLinenumbers */ put_dword( 0x60000020 /* CNT_CODE|MEM_EXECUTE|MEM_READ */ ); /* Characteristics */ @@ -361,7 +361,7 @@ index 55587cb6..2f172033 100644 /* .reloc section */ put_data( ".reloc\0", 8 ); /* Name */ put_dword( label_rva_align("reloc_end") - label_rva("reloc_start") ); /* VirtualSize */ -@@ -964,13 +1137,31 @@ static void output_fake_module_pass( DLLSPEC *spec ) +@@ -1051,13 +1224,31 @@ static void output_fake_module_pass( DLLSPEC *spec ) /* .text contents */ align_output_rva( file_align, section_align ); @@ -400,10 +400,10 @@ index 55587cb6..2f172033 100644 /* .reloc contents */ align_output_rva( file_align, section_align ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index b9c2b329..f4ed3261 100644 +index 07ae445be15..a9f5b9ae336 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c -@@ -528,7 +528,7 @@ size_t output_buffer_size; +@@ -533,7 +533,7 @@ size_t output_buffer_size; struct label { struct list entry; @@ -412,7 +412,7 @@ index b9c2b329..f4ed3261 100644 size_t pos; size_t rva; }; -@@ -546,7 +546,7 @@ struct label *get_label( const char *name ) +@@ -551,7 +551,7 @@ struct label *get_label( const char *name ) } label = xmalloc( sizeof(*label) ); @@ -421,7 +421,7 @@ index b9c2b329..f4ed3261 100644 label->pos = 0; label->rva = 0; -@@ -598,6 +598,7 @@ void free_labels( void ) +@@ -603,6 +603,7 @@ void free_labels( void ) LIST_FOR_EACH_ENTRY_SAFE( label, label2, &labels, struct label, entry ) { list_remove( &label->entry ); @@ -429,7 +429,7 @@ index b9c2b329..f4ed3261 100644 free( label ); } } -@@ -732,6 +733,11 @@ void put_pword( unsigned int val ) +@@ -734,6 +735,11 @@ void put_pword( unsigned int val ) else put_dword( val ); } @@ -442,5 +442,5 @@ index b9c2b329..f4ed3261 100644 { size_t size = align - (output_buffer_pos % align); -- -2.20.1 +2.17.1 diff --git a/patches/wuauserv-Dummy_Service/0001-wuauserv-Add-dummy-service.patch b/patches/wuauserv-Dummy_Service/0001-wuauserv-Add-dummy-service.patch deleted file mode 100644 index 48c5891a..00000000 --- a/patches/wuauserv-Dummy_Service/0001-wuauserv-Add-dummy-service.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 4e8d97cd79c7c7f9a29bcf23a267a0c3015fc817 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Fri, 11 Mar 2016 21:44:53 +0100 -Subject: [PATCH] wuauserv: Add dummy service. - ---- - configure.ac | 1 + - loader/wine.inf.in | 11 ++++ - programs/wuauserv/Makefile.in | 6 ++ - programs/wuauserv/main.c | 104 ++++++++++++++++++++++++++++++++++ - 4 files changed, 122 insertions(+) - create mode 100644 programs/wuauserv/Makefile.in - create mode 100644 programs/wuauserv/main.c - -diff --git a/configure.ac b/configure.ac -index 790729666a0..c0eb7520199 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4042,6 +4042,7 @@ WINE_CONFIG_MAKEFILE(programs/wordpad) - WINE_CONFIG_MAKEFILE(programs/write) - WINE_CONFIG_MAKEFILE(programs/wscript) - WINE_CONFIG_MAKEFILE(programs/wscript/tests) -+WINE_CONFIG_MAKEFILE(programs/wuauserv) - WINE_CONFIG_MAKEFILE(programs/wusa) - WINE_CONFIG_MAKEFILE(programs/xcopy) - WINE_CONFIG_MAKEFILE(programs/xcopy/tests) -diff --git a/loader/wine.inf.in b/loader/wine.inf.in -index c89397223db..9789e5e53b1 100644 ---- a/loader/wine.inf.in -+++ b/loader/wine.inf.in -@@ -135,6 +135,7 @@ AddService=LanmanServer,0,LanmanServerService - AddService=FontCache,0,FontCacheService - AddService=Schedule,0,TaskSchedulerService - AddService=Winmgmt,0,WinmgmtService -+AddService=wuauserv,0,wuauService - - [DefaultInstall.NT.Services] - AddService=BITS,0,BITSService -@@ -150,6 +151,7 @@ AddService=LanmanServer,0,LanmanServerService - AddService=FontCache,0,FontCacheService - AddService=Schedule,0,TaskSchedulerService - AddService=Winmgmt,0,WinmgmtService -+AddService=wuauserv,0,wuauService - - [DefaultInstall.ntamd64.Services] - AddService=BITS,0,BITSService -@@ -165,6 +167,7 @@ AddService=LanmanServer,0,LanmanServerService - AddService=FontCache,0,FontCacheService - AddService=Schedule,0,TaskSchedulerService - AddService=Winmgmt,0,WinmgmtService -+AddService=wuauserv,0,wuauService - - [Strings] - MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions" -@@ -3833,6 +3836,14 @@ ErrorControl=1 - HKR,Parameters,"ServiceDll",,"%11%\schedsvc.dll" - HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"Schedule" - -+[wuauService] -+Description="wuauserv" -+DisplayName="Automatic Updates" -+ServiceBinary="%11%\wuauserv.exe" -+ServiceType=32 -+StartType=3 -+ErrorControl=1 -+ - [Services] - HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" - HKLM,"System\CurrentControlSet\Services\Eventlog\Application",,16 -diff --git a/programs/wuauserv/Makefile.in b/programs/wuauserv/Makefile.in -new file mode 100644 -index 00000000000..16f27f13120 ---- /dev/null -+++ b/programs/wuauserv/Makefile.in -@@ -0,0 +1,6 @@ -+MODULE = wuauserv.exe -+APPMODE = -mconsole -mno-cygwin -+IMPORTS = advapi32 -+ -+C_SRCS = \ -+ main.c -diff --git a/programs/wuauserv/main.c b/programs/wuauserv/main.c -new file mode 100644 -index 00000000000..31df299e90e ---- /dev/null -+++ b/programs/wuauserv/main.c -@@ -0,0 +1,104 @@ -+/* -+ * Copyright 2007 Jacek Caban for CodeWeavers -+ * Copyright 2016 Michael Müller -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#define WIN32_LEAN_AND_MEAN -+ -+#include -+#include -+ -+#include "wine/debug.h" -+ -+WINE_DEFAULT_DEBUG_CHANNEL(wuauserv); -+ -+static WCHAR wuauservW[] = {'w','u','a','u','s','e','r','v',0}; -+ -+static SERVICE_STATUS_HANDLE service_handle; -+static HANDLE stop_event; -+ -+static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_data, LPVOID context ) -+{ -+ SERVICE_STATUS status; -+ -+ status.dwServiceType = SERVICE_WIN32; -+ status.dwControlsAccepted = SERVICE_ACCEPT_STOP; -+ status.dwWin32ExitCode = 0; -+ status.dwServiceSpecificExitCode = 0; -+ status.dwCheckPoint = 0; -+ status.dwWaitHint = 0; -+ -+ switch(ctrl) -+ { -+ case SERVICE_CONTROL_STOP: -+ case SERVICE_CONTROL_SHUTDOWN: -+ WINE_TRACE( "shutting down\n" ); -+ status.dwCurrentState = SERVICE_STOP_PENDING; -+ status.dwControlsAccepted = 0; -+ SetServiceStatus( service_handle, &status ); -+ SetEvent( stop_event ); -+ return NO_ERROR; -+ default: -+ WINE_FIXME( "got service ctrl %x\n", ctrl ); -+ status.dwCurrentState = SERVICE_RUNNING; -+ SetServiceStatus( service_handle, &status ); -+ return NO_ERROR; -+ } -+} -+ -+static void WINAPI serv_main(DWORD argc, LPWSTR *argv) -+{ -+ SERVICE_STATUS status; -+ -+ WINE_TRACE( "starting service\n" ); -+ -+ stop_event = CreateEventW( NULL, TRUE, FALSE, NULL ); -+ -+ service_handle = RegisterServiceCtrlHandlerExW( wuauservW, service_handler, NULL ); -+ if (!service_handle) -+ return; -+ -+ status.dwServiceType = SERVICE_WIN32; -+ status.dwCurrentState = SERVICE_RUNNING; -+ status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; -+ status.dwWin32ExitCode = 0; -+ status.dwServiceSpecificExitCode = 0; -+ status.dwCheckPoint = 0; -+ status.dwWaitHint = 10000; -+ SetServiceStatus( service_handle, &status ); -+ -+ WaitForSingleObject( stop_event, INFINITE ); -+ -+ status.dwCurrentState = SERVICE_STOPPED; -+ status.dwControlsAccepted = 0; -+ SetServiceStatus( service_handle, &status ); -+ WINE_TRACE( "service stopped\n" ); -+} -+ -+int main(int argc, char **argv) -+{ -+ static const SERVICE_TABLE_ENTRYW servtbl[] = -+ { -+ {wuauservW, serv_main}, -+ {NULL, NULL} -+ }; -+ -+ WINE_TRACE( "(%d %p)\n", argc, argv ); -+ -+ StartServiceCtrlDispatcherW( servtbl ); -+ return 0; -+} --- -2.17.1 - diff --git a/patches/wuauserv-Dummy_Service/definition b/patches/wuauserv-Dummy_Service/definition deleted file mode 100644 index a7e6d06f..00000000 --- a/patches/wuauserv-Dummy_Service/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [37781] Implement wuauserv dummy service