From 5306e1df11e772fe8125fcd5857e52cf1f83430b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 11 Jun 2020 15:23:12 +0300 Subject: [PATCH] Updated winebuild-Fake_Dlls patchset. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49357 --- ...-tests-Add-basic-tests-for-fake-dlls.patch | 8 +-- ...-not-abuse-WOW32Reserved-field-for-1.patch | 36 ++++++------- ...ate-syscall-thunks-for-ntdll-exports.patch | 53 +++++++++++-------- ...ltipass-label-system-to-generate-fak.patch | 10 ++-- ...uild-Add-stub-functions-in-fake-dlls.patch | 36 ++++++------- ...uild-Add-syscall-thunks-in-fake-dlls.patch | 8 +-- ...ze-of-relocation-information-in-fake.patch | 4 +- ...-make-sure-RVA-matches-between-fake-.patch | 10 ++-- ...me-file-alignment-for-fake-and-built.patch | 8 +-- ...ebuild-Add-syscall-thunks-for-64-bit.patch | 39 ++++++-------- ...all-NtOpenFile-through-syscall-thunk.patch | 32 +++++------ 11 files changed, 123 insertions(+), 121 deletions(-) diff --git a/patches/winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch b/patches/winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch index ef056cfcf..21d69fd59 100644 --- a/patches/winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch +++ b/patches/winebuild-Fake_Dlls/0001-kernel32-tests-Add-basic-tests-for-fake-dlls.patch @@ -1,4 +1,4 @@ -From de68d5c0e6bd728788bbec09100ea59802b8ff13 Mon Sep 17 00:00:00 2001 +From 8b88aa45856684e63786425f72886f2ac57b3630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 25 May 2017 07:02:46 +0200 Subject: [PATCH] kernel32/tests: Add basic tests for fake dlls. @@ -8,10 +8,10 @@ Subject: [PATCH] kernel32/tests: Add basic tests for fake dlls. 1 file changed, 91 insertions(+) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 5474d543248..4e7a15970cb 100644 +index ef8c47c04f1a..efd5a25a432d 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1535,6 +1535,96 @@ static void test_filenames(void) +@@ -1572,6 +1572,96 @@ static void test_filenames(void) DeleteFileA( long_path ); } @@ -108,7 +108,7 @@ index 5474d543248..4e7a15970cb 100644 /* Verify linking style of import descriptors */ static void test_ImportDescriptors(void) { -@@ -3997,6 +4087,7 @@ START_TEST(loader) +@@ -4094,6 +4184,7 @@ START_TEST(loader) return; } diff --git a/patches/winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch b/patches/winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch index 15aaa85df..ae98c2798 100644 --- a/patches/winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch +++ b/patches/winebuild-Fake_Dlls/0002-krnl386.exe16-Do-not-abuse-WOW32Reserved-field-for-1.patch @@ -1,4 +1,4 @@ -From 25d08438aba3dee16c79ce3168a4f76f39816fad Mon Sep 17 00:00:00 2001 +From 7af81866f286e60f601d1c3f9bfe8592a794d21d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 16 May 2017 04:37:52 +0200 Subject: [PATCH] krnl386.exe16: Do not abuse WOW32Reserved field for 16-bit @@ -24,7 +24,7 @@ Subject: [PATCH] krnl386.exe16: Do not abuse WOW32Reserved field for 16-bit 16 files changed, 78 insertions(+), 77 deletions(-) diff --git a/dlls/dbghelp/cpu_i386.c b/dlls/dbghelp/cpu_i386.c -index fd808a0d324..7d6723977a2 100644 +index fd808a0d3248..7d6723977a29 100644 --- a/dlls/dbghelp/cpu_i386.c +++ b/dlls/dbghelp/cpu_i386.c @@ -213,16 +213,16 @@ static BOOL i386_stack_walk(struct cpu_stack_walk *csw, STACKFRAME64 *frame, @@ -48,7 +48,7 @@ index fd808a0d324..7d6723977a2 100644 } next_switch = p; diff --git a/dlls/krnl386.exe16/kernel.c b/dlls/krnl386.exe16/kernel.c -index 07a57d0d937..89ea5c042e7 100644 +index 07a57d0d9372..89ea5c042e71 100644 --- a/dlls/krnl386.exe16/kernel.c +++ b/dlls/krnl386.exe16/kernel.c @@ -47,8 +47,8 @@ static void thread_attach(void) @@ -72,7 +72,7 @@ index 07a57d0d937..89ea5c042e7 100644 } diff --git a/dlls/krnl386.exe16/kernel16_private.h b/dlls/krnl386.exe16/kernel16_private.h -index f15934daa0e..9f939a9d5ba 100644 +index f15934daa0e4..9f939a9d5bac 100644 --- a/dlls/krnl386.exe16/kernel16_private.h +++ b/dlls/krnl386.exe16/kernel16_private.h @@ -169,7 +169,7 @@ extern THHOOK *pThhook DECLSPEC_HIDDEN; @@ -119,7 +119,7 @@ index f15934daa0e..9f939a9d5ba 100644 static inline struct kernel_thread_data *kernel_get_thread_data(void) diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c -index f1e1a14dd67..c951a18f869 100644 +index f1e1a14dd679..c951a18f8699 100644 --- a/dlls/krnl386.exe16/ne_module.c +++ b/dlls/krnl386.exe16/ne_module.c @@ -1208,7 +1208,7 @@ DWORD NE_StartTask(void) @@ -143,7 +143,7 @@ index f1e1a14dd67..c951a18f869 100644 WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)&context ); ExitThread( LOWORD(context.Eax) ); diff --git a/dlls/krnl386.exe16/ne_segment.c b/dlls/krnl386.exe16/ne_segment.c -index aa886148029..70eb3360914 100644 +index aa8861480298..70eb33609144 100644 --- a/dlls/krnl386.exe16/ne_segment.c +++ b/dlls/krnl386.exe16/ne_segment.c @@ -370,9 +370,9 @@ BOOL NE_LoadSegment( NE_MODULE *pModule, WORD segnum ) @@ -209,7 +209,7 @@ index aa886148029..70eb3360914 100644 args[7] = HIWORD(dwReason); args[6] = LOWORD(dwReason); diff --git a/dlls/krnl386.exe16/task.c b/dlls/krnl386.exe16/task.c -index 39a60cb97a9..21de62c5a01 100644 +index 39a60cb97a94..21de62c5a015 100644 --- a/dlls/krnl386.exe16/task.c +++ b/dlls/krnl386.exe16/task.c @@ -624,7 +624,7 @@ void WINAPI InitTask16( CONTEXT *context ) @@ -267,7 +267,7 @@ index 39a60cb97a9..21de62c5a01 100644 context->Esp = OFFSETOF(pData->old_ss_sp) - sizeof(DWORD); /*ret addr*/ pData->old_ss_sp = 0; diff --git a/dlls/krnl386.exe16/thunk.c b/dlls/krnl386.exe16/thunk.c -index e913a08f88c..ecc94371488 100644 +index e913a08f88cc..ecc94371488f 100644 --- a/dlls/krnl386.exe16/thunk.c +++ b/dlls/krnl386.exe16/thunk.c @@ -429,7 +429,7 @@ void WINAPI __regs_QT_Thunk( CONTEXT *context ) @@ -413,7 +413,7 @@ index e913a08f88c..ecc94371488 100644 if (OFFSETOF(frame32->frame16) > lpbuf[2]) { diff --git a/dlls/krnl386.exe16/wowthunk.c b/dlls/krnl386.exe16/wowthunk.c -index 2dddbf93289..3a4b104a673 100644 +index 2dddbf932898..3a4b104a673f 100644 --- a/dlls/krnl386.exe16/wowthunk.c +++ b/dlls/krnl386.exe16/wowthunk.c @@ -127,7 +127,7 @@ static DWORD call16_handler( EXCEPTION_RECORD *record, EXCEPTION_REGISTRATION_RE @@ -473,7 +473,7 @@ index 2dddbf93289..3a4b104a673 100644 } } diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c -index 2928f314358..138f56b94eb 100644 +index ac34f86a5883..55f1e2ce4b23 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -645,7 +645,7 @@ static inline void *init_handler( const ucontext_t *sigcontext ) @@ -486,7 +486,7 @@ index 2928f314358..138f56b94eb 100644 return (void *)(ESP_sig(sigcontext) & ~3); } diff --git a/dlls/system.drv16/system.c b/dlls/system.drv16/system.c -index b6fd51c05f0..695ad7b6003 100644 +index b6fd51c05f01..695ad7b60039 100644 --- a/dlls/system.drv16/system.c +++ b/dlls/system.drv16/system.c @@ -70,7 +70,7 @@ static void CALLBACK SYSTEM_TimerTick( LPVOID arg, DWORD low, DWORD high ) @@ -499,7 +499,7 @@ index b6fd51c05f0..695ad7b6003 100644 WOWCallback16Ex( 0, WCB16_REGS, 0, NULL, (DWORD *)&context ); diff --git a/dlls/toolhelp.dll16/toolhelp.c b/dlls/toolhelp.dll16/toolhelp.c -index 578d1ae7fab..1077f0b0367 100644 +index 578d1ae7faba..1077f0b03672 100644 --- a/dlls/toolhelp.dll16/toolhelp.c +++ b/dlls/toolhelp.dll16/toolhelp.c @@ -491,8 +491,8 @@ BOOL16 WINAPI TaskNext16( TASKENTRY *lpte ) @@ -523,7 +523,7 @@ index 578d1ae7fab..1077f0b0367 100644 WORD user = LoadLibrary16( "USER.EXE" ); WORD gdi = LoadLibrary16( "GDI.EXE" ); diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c -index e3ca3fd779d..fa9388ceaa1 100644 +index e3ca3fd779d3..fa9388ceaa11 100644 --- a/dlls/user.exe16/message.c +++ b/dlls/user.exe16/message.c @@ -240,11 +240,11 @@ static LRESULT call_window_proc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, LPA @@ -595,7 +595,7 @@ index e3ca3fd779d..fa9388ceaa1 100644 stack16->ds = GetWindowLongPtrW( hwnd, GWLP_HINSTANCE ); diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c -index 27b92793836..deec596f766 100644 +index 27b92793836a..deec596f7660 100644 --- a/dlls/user.exe16/user.c +++ b/dlls/user.exe16/user.c @@ -1394,7 +1394,7 @@ DWORD WINAPI GetTabbedTextExtent16( HDC16 hdc, LPCSTR lpstr, INT16 count, @@ -617,7 +617,7 @@ index 27b92793836..deec596f766 100644 int userPercent, gdiPercent; diff --git a/dlls/user.exe16/window.c b/dlls/user.exe16/window.c -index bf86719325b..1f53bdc9540 100644 +index bf86719325b8..1f53bdc95402 100644 --- a/dlls/user.exe16/window.c +++ b/dlls/user.exe16/window.c @@ -456,7 +456,7 @@ HWND16 WINAPI GetParent16( HWND16 hwnd ) @@ -630,10 +630,10 @@ index bf86719325b..1f53bdc9540 100644 /* don't use WIN_Handle32 here, we don't care about the full handle */ return IsWindow( HWND_32(hwnd) ); diff --git a/include/winternl.h b/include/winternl.h -index acbce20c212..68c1ae3fd82 100644 +index 87eb0d32926b..2d9f54b89d8c 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -362,7 +362,7 @@ typedef struct _TEB +@@ -363,7 +363,7 @@ typedef struct _TEB PVOID WOW32Reserved; /* 0c0/0100 */ ULONG CurrentLocale; /* 0c4/0108 */ ULONG FpSoftwareStatusRegister; /* 0c8/010c */ @@ -643,7 +643,7 @@ index acbce20c212..68c1ae3fd82 100644 ACTIVATION_CONTEXT_STACK ActivationContextStack; /* 1a8/02c8 */ BYTE SpareBytes1[24]; /* 1bc/02e8 */ diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c -index 29d0a74c833..01bb97e02b4 100644 +index 29d0a74c833c..01bb97e02b4c 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -31,7 +31,7 @@ diff --git a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch index 547e27f8f..a0487f91b 100644 --- a/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch +++ b/patches/winebuild-Fake_Dlls/0003-winebuild-Generate-syscall-thunks-for-ntdll-exports.patch @@ -1,4 +1,4 @@ -From 0c4d2573b123f2198f74292133b7a6eefa472620 Mon Sep 17 00:00:00 2001 +From d8ff827f7a94aee2bed89c620120af0a148ca81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 11 May 2017 05:32:55 +0200 Subject: [PATCH] winebuild: Generate syscall thunks for ntdll exports. @@ -8,7 +8,7 @@ Based on a patch by Erich E. Hoover. dlls/ntdll/loader.c | 3 + dlls/ntdll/signal_i386.c | 4 +- dlls/ntdll/tests/exception.c | 2 + - dlls/ntdll/thread.c | 3 +- + dlls/ntdll/thread.c | 10 +++- dlls/ntdll/unix/thread.c | 3 +- dlls/ntdll/unix/unix_private.h | 2 +- dlls/ntdll/unixlib.h | 4 +- @@ -19,13 +19,13 @@ Based on a patch by Erich E. Hoover. tools/winebuild/spec16.c | 22 +------ tools/winebuild/spec32.c | 104 +++++++++++++++++++++++++++++++++ tools/winebuild/utils.c | 21 +++++++ - 14 files changed, 214 insertions(+), 32 deletions(-) + 14 files changed, 221 insertions(+), 32 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 0c8f05285c4..26c540050dc 100644 +index 2553b0b9d397..cac6aae2f3dd 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -3810,6 +3810,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -4021,6 +4021,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) return ret; } @@ -33,7 +33,7 @@ index 0c8f05285c4..26c540050dc 100644 /****************************************************************** * LdrInitializeThunk (NTDLL.@) -@@ -3826,6 +3827,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -4038,6 +4039,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow WINE_MODREF *wm; LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; @@ -43,7 +43,7 @@ index 0c8f05285c4..26c540050dc 100644 RtlEnterCriticalSection( &loader_section ); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c -index 21cc1b3ead4..18be5693a7d 100644 +index 21cc1b3ead40..18be5693a7d2 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -346,6 +346,8 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, @@ -65,7 +65,7 @@ index 21cc1b3ead4..18be5693a7d 100644 } return unix_funcs->NtGetContextThread( handle, context ); diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c -index a5e6faa461a..51938bf84cc 100644 +index 1389a542cdee..54796476e25b 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1643,6 +1643,8 @@ static void test_thread_context(void) @@ -78,18 +78,25 @@ index a5e6faa461a..51938bf84cc 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/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 5a6809638ae..fa10cdf1062 100644 +index ff5fe9d6226a..e93498b27ea0 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -170,6 +170,7 @@ int __cdecl __wine_dbg_output( const char *str ) +@@ -220,6 +220,14 @@ int __cdecl __wine_dbg_output( const char *str ) return unix_funcs->dbg_output( str ); } ++#if defined(__i386__) || defined(__x86_64__) +extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); ++#else ++void __wine_syscall_dispatcher( void ) ++{ ++ FIXME("Syscall dispatcher is not available for this architecture.\n"); ++} ++#endif /*********************************************************************** * thread_init -@@ -181,7 +182,7 @@ int __cdecl __wine_dbg_output( const char *str ) +@@ -231,7 +239,7 @@ int __cdecl __wine_dbg_output( const char *str ) TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) { TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus, @@ -99,7 +106,7 @@ index 5a6809638ae..fa10cdf1062 100644 peb = teb->Peb; peb->FastPebLock = &peb_lock; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index 97b191e1a5b..2dbaa43e731 100644 +index 97b191e1a5b3..2dbaa43e731a 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -85,7 +85,7 @@ static void pthread_exit_wrapper( int status ) @@ -120,10 +127,10 @@ index 97b191e1a5b..2dbaa43e731 100644 thread_data->request_fd = -1; thread_data->reply_fd = -1; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 19dd216fc35..a1c48a52606 100644 +index 92a58417827b..33a551e947c2 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -107,7 +107,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE +@@ -108,7 +108,7 @@ extern void CDECL server_release_fd( HANDLE handle, int unix_fd ) DECLSPEC_HIDDE extern void CDECL server_init_process_done( void *relay ) DECLSPEC_HIDDEN; extern TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZE_T *size, BOOL *suspend, unsigned int *cpus, BOOL *wow64, @@ -133,7 +140,7 @@ index 19dd216fc35..a1c48a52606 100644 extern void CDECL DECLSPEC_NORETURN exit_process( int status ) DECLSPEC_HIDDEN; extern NTSTATUS CDECL get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h -index 4c580c49d13..4f0080db03d 100644 +index 4c580c49d139..4f0080db03d9 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -28,7 +28,7 @@ struct ldt_copy; @@ -155,10 +162,10 @@ index 4c580c49d13..4f0080db03d 100644 void (CDECL *exit_process)( int status ); NTSTATUS (CDECL *get_thread_ldt_entry)( HANDLE handle, void *data, ULONG len, ULONG *ret_len ); diff --git a/include/winternl.h b/include/winternl.h -index 68c1ae3fd82..f2da9157aab 100644 +index 2d9f54b89d8c..0c15a0ee6c34 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -359,7 +359,7 @@ typedef struct _TEB +@@ -360,7 +360,7 @@ typedef struct _TEB PVOID CsrClientThread; /* 03c/0070 */ PVOID Win32ThreadInfo; /* 040/0078 */ ULONG Win32ClientInfo[31]; /* 044/0080 used for user32 private data in Wine */ @@ -168,7 +175,7 @@ index 68c1ae3fd82..f2da9157aab 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 c162888a035..55d5b0b9dc2 100644 +index c162888a0356..55d5b0b9dc28 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -105,6 +105,7 @@ typedef struct @@ -216,7 +223,7 @@ index c162888a035..55d5b0b9dc2 100644 extern int byte_swapped; diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c -index 04ab433dd65..0c6bafed8e5 100644 +index 04ab433dd65a..0c6bafed8e54 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -531,6 +531,7 @@ static void check_undefined_forwards( DLLSPEC *spec ) @@ -256,7 +263,7 @@ index 04ab433dd65..0c6bafed8e5 100644 } } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c -index 0f2b9c1e10a..74216f8bb6e 100644 +index 0f2b9c1e10ad..74216f8bb6e7 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -543,6 +543,24 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) @@ -347,7 +354,7 @@ index 0f2b9c1e10a..74216f8bb6e 100644 } diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c -index a52c03aaa6a..15ef9a3f893 100644 +index a52c03aaa6a7..15ef9a3f8930 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -495,27 +495,6 @@ static int relay_type_compare( const void *e1, const void *e2 ) @@ -387,7 +394,7 @@ index a52c03aaa6a..15ef9a3f893 100644 entry_point->u.func.nb_args = 0; assert( !spec->ordinals[0] ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index b1e20e0484d..22dd399cb2b 100644 +index b1e20e0484dc..22dd399cb2b4 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -374,6 +374,109 @@ static void output_relay_debug( DLLSPEC *spec ) @@ -509,7 +516,7 @@ index b1e20e0484d..22dd399cb2b 100644 output_exports( spec ); output_imports( spec ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 2a1fc960926..07a579004ad 100644 +index 2a1fc960926b..07a579004adc 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -860,6 +860,7 @@ void free_dll_spec( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch b/patches/winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch index 6c3984f8b..d4813799e 100644 --- a/patches/winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch +++ b/patches/winebuild-Fake_Dlls/0004-winebuild-Use-multipass-label-system-to-generate-fak.patch @@ -1,4 +1,4 @@ -From 15182deeb13e26abdb3067a77353354726ac82aa Mon Sep 17 00:00:00 2001 +From 344eb39bdfee74d4d826fa2f61a95736f0ee9823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 15 May 2017 02:05:49 +0200 Subject: [PATCH] winebuild: Use multipass label system to generate fake dlls. @@ -11,7 +11,7 @@ Subject: [PATCH] winebuild: Use multipass label system to generate fake dlls. 4 files changed, 181 insertions(+), 63 deletions(-) diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h -index 6ee847f908c..210324406a9 100644 +index 55d5b0b9dc28..8930df408d3b 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -343,6 +343,7 @@ extern size_t input_buffer_pos; @@ -35,7 +35,7 @@ index 6ee847f908c..210324406a9 100644 /* global variables */ diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c -index bd55bb2fa5c..d9329019f8a 100644 +index bd55bb2fa5c4..d9329019f8a3 100644 --- a/tools/winebuild/res32.c +++ b/tools/winebuild/res32.c @@ -539,7 +539,6 @@ void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ) @@ -47,7 +47,7 @@ index bd55bb2fa5c..d9329019f8a 100644 /* output the resource directories */ diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index 22dd399cb2b..c38f1fe663c 100644 +index 22dd399cb2b4..c38f1fe663c7 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -844,11 +844,11 @@ void output_spec32_file( DLLSPEC *spec ) @@ -279,7 +279,7 @@ index 22dd399cb2b..c38f1fe663c 100644 } diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 7dc61a708db..64e1fa51455 100644 +index 07a579004adc..80dec6db29ea 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -34,6 +34,7 @@ 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 f96d51aee..4ac05a314 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,4 +1,4 @@ -From 167ad04157dd746ee9395afa9505fe00cc866f9b Mon Sep 17 00:00:00 2001 +From e5fc6ee60be5dd3b80af96dcbd81adb742ba7a5d 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: [PATCH] winebuild: Add stub functions in fake dlls. @@ -14,10 +14,10 @@ Subject: [PATCH] winebuild: Add stub functions in fake dlls. 7 files changed, 251 insertions(+), 15 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 926fa913866..902907329c0 100644 +index efd5a25a432d..182b61b731a2 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1596,9 +1596,7 @@ static void test_FakeDLL(void) +@@ -1597,9 +1597,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); @@ -27,7 +27,7 @@ index 926fa913866..902907329c0 100644 names = RVAToAddr(dir->AddressOfNames, ptr); ordinals = RVAToAddr(dir->AddressOfNameOrdinals, ptr); -@@ -1627,17 +1625,20 @@ todo_wine +@@ -1628,17 +1626,20 @@ todo_wine /* check position in memory */ dll_rva = (DWORD_PTR)dll_func - (DWORD_PTR)module; map_rva = funcs[ordinals[i]]; @@ -48,7 +48,7 @@ index 926fa913866..902907329c0 100644 ok(!memcmp(map_func, dll_func, 0x20), "%s: Function content does not match!\n", func_name); if (!strcmp(func_name, "NtSetEvent")) -@@ -1651,10 +1652,11 @@ todo_wine +@@ -1652,10 +1653,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"); @@ -62,10 +62,10 @@ index 926fa913866..902907329c0 100644 CloseHandle(map); CloseHandle(file); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 26c540050dc..09d3870c31a 100644 +index cac6aae2f3dd..51d989f30b45 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -3811,6 +3811,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) +@@ -4022,6 +4022,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule) } extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); @@ -73,7 +73,7 @@ index 26c540050dc..09d3870c31a 100644 /****************************************************************** * LdrInitializeThunk (NTDLL.@) -@@ -3828,6 +3829,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow +@@ -4040,6 +4041,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer; NtCurrentTeb()->WOW32Reserved = __wine_syscall_dispatcher; @@ -82,12 +82,12 @@ index 26c540050dc..09d3870c31a 100644 if (process_detaching) return; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index fa10cdf1062..4840f527e59 100644 +index e93498b27ea0..a14e3a12ae0c 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c -@@ -172,6 +172,39 @@ int __cdecl __wine_dbg_output( const char *str ) - - extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); +@@ -229,6 +229,39 @@ void __wine_syscall_dispatcher( void ) + } + #endif +void *WINAPI __wine_fakedll_dispatcher( const char *module, ULONG ord ) +{ @@ -125,7 +125,7 @@ index fa10cdf1062..4840f527e59 100644 /*********************************************************************** * thread_init * -@@ -183,6 +216,7 @@ TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) +@@ -240,6 +273,7 @@ TEB *thread_init( SIZE_T *info_size, BOOL *suspend ) { TEB *teb = unix_funcs->init_threading( &nb_threads, &__wine_ldt_copy, info_size, suspend, &server_cpus, &is_wow64, &server_start_time, __wine_syscall_dispatcher ); @@ -134,10 +134,10 @@ index fa10cdf1062..4840f527e59 100644 peb = teb->Peb; peb->FastPebLock = &peb_lock; diff --git a/include/winternl.h b/include/winternl.h -index f2da9157aab..ce8021af503 100644 +index 0c15a0ee6c34..6da672e979e5 100644 --- a/include/winternl.h +++ b/include/winternl.h -@@ -398,7 +398,7 @@ typedef struct _TEB +@@ -399,7 +399,7 @@ typedef struct _TEB PVOID Instrumentation[16]; /* f2c/16b8 */ PVOID WinSockData; /* f6c/1738 */ ULONG GdiBatchCount; /* f70/1740 */ @@ -147,7 +147,7 @@ index f2da9157aab..ce8021af503 100644 PVOID ReservedForPerf; /* f7c/1750 */ PVOID ReservedForOle; /* f80/1758 */ diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h -index 8930df408d3..44113bad28a 100644 +index 8930df408d3b..44113bad28af 100644 --- a/tools/winebuild/build.h +++ b/tools/winebuild/build.h @@ -358,6 +358,7 @@ extern void put_word( unsigned short val ); @@ -159,7 +159,7 @@ index 8930df408d3..44113bad28a 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 c38f1fe663c..bf82ca497c0 100644 +index c38f1fe663c7..bf82ca497c0d 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -843,6 +843,163 @@ void output_spec32_file( DLLSPEC *spec ) @@ -415,7 +415,7 @@ index c38f1fe663c..bf82ca497c0 100644 /* .reloc contents */ align_output_rva( file_align, section_align ); diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c -index 80dec6db29e..d394a1382c6 100644 +index 80dec6db29ea..d394a1382c68 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -549,7 +549,7 @@ size_t output_buffer_size; diff --git a/patches/winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch b/patches/winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch index 5ae2b3deb..13f46d6b0 100644 --- a/patches/winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch +++ b/patches/winebuild-Fake_Dlls/0006-winebuild-Add-syscall-thunks-in-fake-dlls.patch @@ -1,4 +1,4 @@ -From 84a9f7b8192d7735108da2d7e81cf63faef97c13 Mon Sep 17 00:00:00 2001 +From fd72d405abba827ab5e2603551d48200aedad3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 15 May 2017 17:56:48 +0200 Subject: [PATCH] winebuild: Add syscall thunks in fake dlls. @@ -9,10 +9,10 @@ Subject: [PATCH] winebuild: Add syscall thunks in fake dlls. 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index ec173c94a8e..a3bed8b310b 100644 +index 182b61b731a2..98369c7d508c 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1602,7 +1602,6 @@ static void test_FakeDLL(void) +@@ -1639,7 +1639,6 @@ static void test_FakeDLL(void) /* check function content */ map_func = RVAToAddr(map_rva, ptr); @@ -21,7 +21,7 @@ index ec173c94a8e..a3bed8b310b 100644 if (!strcmp(func_name, "NtSetEvent")) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index bf82ca497c0..6968e41260f 100644 +index bf82ca497c0d..6968e41260f1 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -860,13 +860,36 @@ static void create_stub_exports_text( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch b/patches/winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch index 92a7161de..3b3745ed6 100644 --- a/patches/winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch +++ b/patches/winebuild-Fake_Dlls/0007-winebuild-Fix-size-of-relocation-information-in-fake.patch @@ -1,4 +1,4 @@ -From d77c31b1567bfbde1ce4ceb526ad596d0be3e788 Mon Sep 17 00:00:00 2001 +From f92fc0572be02ce2eee2a9cbf60724372678a5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 25 May 2017 03:22:25 +0200 Subject: [PATCH] winebuild: Fix size of relocation information in fake dlls. @@ -8,7 +8,7 @@ Subject: [PATCH] winebuild: Fix size of relocation information in fake dlls. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index 6968e41260f..f95b45b9a0d 100644 +index 6968e41260f1..f95b45b9a0d5 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -1238,8 +1238,8 @@ static void output_fake_module_pass( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch b/patches/winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch index c4f1fb004..2cb4b7cf1 100644 --- a/patches/winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch +++ b/patches/winebuild-Fake_Dlls/0008-winebuild-Try-to-make-sure-RVA-matches-between-fake-.patch @@ -1,4 +1,4 @@ -From afa59bbabca36f306e9db4c1b080a250c4a919ea Mon Sep 17 00:00:00 2001 +From 59efee63a7442dfee4d9e76b11f651a11a4b523e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 25 May 2017 21:46:27 +0200 Subject: [PATCH] winebuild: Try to make sure RVA matches between fake and @@ -11,10 +11,10 @@ Subject: [PATCH] winebuild: Try to make sure RVA matches between fake and 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index a3bed8b310b..8b5a345b086 100644 +index 98369c7d508c..77e73b3ca37b 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1589,7 +1589,6 @@ static void test_FakeDLL(void) +@@ -1626,7 +1626,6 @@ static void test_FakeDLL(void) /* check position in memory */ dll_rva = (DWORD_PTR)dll_func - (DWORD_PTR)module; map_rva = funcs[ordinals[i]]; @@ -23,7 +23,7 @@ index a3bed8b310b..8b5a345b086 100644 func_name, dll_rva, map_rva); diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index c3b59d90224..b6847ca77b3 100644 +index c3b59d902243..b6847ca77b31 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -335,8 +335,12 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) @@ -54,7 +54,7 @@ index c3b59d90224..b6847ca77b3 100644 memcpy( sec->Name, ".text", sizeof(".text") ); diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index f95b45b9a0d..07d6eed05fc 100644 +index f95b45b9a0d5..07d6eed05fcc 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -381,14 +381,25 @@ static void output_relay_debug( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch b/patches/winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch index e0ae33a59..9113beb5f 100644 --- a/patches/winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch +++ b/patches/winebuild-Fake_Dlls/0009-libs-wine-Use-same-file-alignment-for-fake-and-built.patch @@ -1,4 +1,4 @@ -From 29478273c4db90d209ac5afbdc1dd80add3d2c7e Mon Sep 17 00:00:00 2001 +From 370eccb19c65a8b02abfa31a76651ae533dda22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 25 May 2017 21:56:06 +0200 Subject: [PATCH] libs/wine: Use same file alignment for fake and builtin DLLs. @@ -9,10 +9,10 @@ Subject: [PATCH] libs/wine: Use same file alignment for fake and builtin DLLs. 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 8b5a345b086..5373dc4efe1 100644 +index 77e73b3ca37b..1f525194ce73 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1595,7 +1595,6 @@ static void test_FakeDLL(void) +@@ -1632,7 +1632,6 @@ static void test_FakeDLL(void) /* check position in file */ map_offset = (DWORD_PTR)RtlImageRvaToVa(RtlImageNtHeader(ptr), ptr, map_rva, NULL) - (DWORD_PTR)ptr; dll_offset = (DWORD_PTR)RtlImageRvaToVa(RtlImageNtHeader(module), module, dll_rva, NULL) - (DWORD_PTR)module; @@ -21,7 +21,7 @@ index 8b5a345b086..5373dc4efe1 100644 func_name, map_offset, dll_offset); diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index b6847ca77b3..4597a6cb324 100644 +index b6847ca77b31..4597a6cb3243 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -398,7 +398,7 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) diff --git a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch index 6024e5a2f..e40a80148 100644 --- a/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch +++ b/patches/winebuild-Fake_Dlls/0010-tools-winebuild-Add-syscall-thunks-for-64-bit.patch @@ -1,4 +1,4 @@ -From a5b4feebd008daab008f72567fe0001da619030e Mon Sep 17 00:00:00 2001 +From 6f1973aa2aee35139ae041e59d37a45ff22dc5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 7 Sep 2017 00:38:09 +0200 Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit. @@ -7,18 +7,18 @@ Subject: [PATCH] tools/winebuild: Add syscall thunks for 64 bit. dlls/kernel32/tests/loader.c | 7 +- dlls/ntdll/unix/thread.c | 2 +- dlls/ntdll/unix/unix_private.h | 2 +- - dlls/ntdll/unix/virtual.c | 12 +- + dlls/ntdll/unix/virtual.c | 11 +- libs/wine/loader.c | 4 + server/mapping.c | 6 +- tools/winebuild/parser.c | 2 +- tools/winebuild/spec32.c | 285 ++++++++++++++++++++++++++++++++- - 8 files changed, 306 insertions(+), 14 deletions(-) + 8 files changed, 305 insertions(+), 14 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c -index 95939ba6bde..ae5462f6e55 100644 +index 1f525194ce73..21af7b4ce7a4 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c -@@ -1573,7 +1573,7 @@ static void test_filenames(void) +@@ -1574,7 +1574,7 @@ static void test_filenames(void) static void test_FakeDLL(void) { @@ -27,7 +27,7 @@ index 95939ba6bde..ae5462f6e55 100644 NTSTATUS (WINAPI *pNtSetEvent)(HANDLE, ULONG *) = NULL; IMAGE_EXPORT_DIRECTORY *dir; HMODULE module = GetModuleHandleA("ntdll.dll"); -@@ -1615,8 +1615,13 @@ static void test_FakeDLL(void) +@@ -1616,8 +1616,13 @@ static void test_FakeDLL(void) dll_func = (BYTE *)GetProcAddress(module, func_name); ok(dll_func != NULL, "%s: GetProcAddress returned NULL\n", func_name); @@ -42,7 +42,7 @@ index 95939ba6bde..ae5462f6e55 100644 todo_wine ok(0, "%s: Export is a stub-function, skipping\n", func_name); continue; diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index 2dbaa43e731..e1da90222d3 100644 +index 2dbaa43e731a..e1da90222d38 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -110,7 +110,7 @@ TEB * CDECL init_threading( int *nb_threads_ptr, struct ldt_copy **ldt_copy, SIZ @@ -55,10 +55,10 @@ index 2dbaa43e731..e1da90222d3 100644 if (size) *size = info_size; diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index a1c48a52606..9c9e5b80b0c 100644 +index 33a551e947c2..d06f366d3c6d 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -152,7 +152,7 @@ extern void virtual_init(void) DECLSPEC_HIDDEN; +@@ -153,7 +153,7 @@ extern void virtual_init(void) DECLSPEC_HIDDEN; extern TEB *virtual_alloc_first_teb(void) DECLSPEC_HIDDEN; extern NTSTATUS virtual_alloc_teb( TEB **ret_teb ) DECLSPEC_HIDDEN; extern void virtual_free_teb( TEB *teb ) DECLSPEC_HIDDEN; @@ -68,10 +68,10 @@ index a1c48a52606..9c9e5b80b0c 100644 extern BOOL virtual_is_valid_code_address( const void *addr, SIZE_T size ) DECLSPEC_HIDDEN; extern int virtual_handle_stack_fault( void *addr ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c -index 660323d4dcc..a5e5cb8422d 100644 +index 9fb2ecd38ca3..ad11485d1cea 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c -@@ -2588,14 +2588,14 @@ TEB *virtual_alloc_first_teb(void) +@@ -2772,14 +2772,14 @@ TEB *virtual_alloc_first_teb(void) TEB *teb; PEB *peb; NTSTATUS status; @@ -88,12 +88,7 @@ index 660323d4dcc..a5e5cb8422d 100644 if (status) { ERR( "wine: failed to map the shared user data: %08x\n", status ); -@@ -2787,11 +2787,12 @@ void virtual_clear_thread_stack( void *stack_end ) - if (force_exec_prot) mprotect( stack, size, PROT_READ | PROT_WRITE | PROT_EXEC ); - } - -+extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void ); - +@@ -2977,7 +2977,7 @@ void virtual_clear_thread_stack( void *stack_end ) /*********************************************************************** * virtual_map_user_shared_data */ @@ -102,7 +97,7 @@ index 660323d4dcc..a5e5cb8422d 100644 { static const WCHAR wine_usdW[] = {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s', '\\','_','_','w','i','n','e','_','u','s','e','r','_','s','h','a','r','e','d','_','d','a','t','a',0}; -@@ -2814,6 +2815,11 @@ void virtual_map_user_shared_data(void) +@@ -3000,6 +3000,11 @@ void virtual_map_user_shared_data(void) ERR( "failed to remap the process USD: %d\n", res ); exit(1); } @@ -115,7 +110,7 @@ index 660323d4dcc..a5e5cb8422d 100644 NtClose( section ); } diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 4597a6cb324..3d0d75e9c6d 100644 +index 4597a6cb3243..3d0d75e9c6d3 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -398,7 +398,11 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) @@ -131,7 +126,7 @@ index 4597a6cb324..3d0d75e9c6d 100644 sec++; diff --git a/server/mapping.c b/server/mapping.c -index 0941dd87c05..002f3215af2 100644 +index 0941dd87c05d..002f3215af2e 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -964,7 +964,11 @@ struct object *create_user_data_mapping( struct object *root, const struct unico @@ -148,7 +143,7 @@ index 0941dd87c05..002f3215af2 100644 } diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c -index 74216f8bb6e..820516329a4 100644 +index 74216f8bb6e7..820516329a47 100644 --- a/tools/winebuild/parser.c +++ b/tools/winebuild/parser.c @@ -545,7 +545,7 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp ) @@ -161,7 +156,7 @@ index 74216f8bb6e..820516329a4 100644 if (odp->flags & (FLAG_FORWARD | FLAG_REGISTER)) return 0; diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c -index 07d6eed05fc..9cc4698d0d7 100644 +index 07d6eed05fcc..9cc4698d0d7d 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -375,11 +375,11 @@ static void output_relay_debug( DLLSPEC *spec ) diff --git a/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch b/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch index 69ee26be8..c3e065b26 100644 --- a/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch +++ b/patches/winebuild-Fake_Dlls/0011-ntdll-Call-NtOpenFile-through-syscall-thunk.patch @@ -1,4 +1,4 @@ -From 659e192979eecfb59d1c1b26e8cea78c42300de5 Mon Sep 17 00:00:00 2001 +From feb53ed39179603391eff600ea59edc41407b238 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 3 Jan 2020 17:39:08 +0300 Subject: [PATCH] ntdll: Call NtOpenFile through syscall thunk. @@ -15,10 +15,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48410 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c -index 1ca794ae3e5..b3c13042adc 100644 +index a25cefa555ac..34ba0dc813c6 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c -@@ -2892,7 +2892,7 @@ static NTSTATUS open_nt_file( HANDLE *handle, UNICODE_STRING *name ) +@@ -2894,7 +2894,7 @@ static NTSTATUS open_nt_file( HANDLE *handle, UNICODE_STRING *name ) attr.ObjectName = name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; @@ -27,7 +27,7 @@ index 1ca794ae3e5..b3c13042adc 100644 } static NTSTATUS get_manifest_in_module( struct actctx_loader* acl, struct assembly_identity* ai, -@@ -3209,7 +3209,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit +@@ -3211,7 +3211,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; @@ -37,10 +37,10 @@ index 1ca794ae3e5..b3c13042adc 100644 { sxs_ai = *ai; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c -index d18df38f626..69607a4fed9 100644 +index 18428658a5b5..7a9de26ccb0c 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c -@@ -2943,7 +2943,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd ) +@@ -3071,7 +3071,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd ) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; @@ -50,10 +50,10 @@ index d18df38f626..69607a4fed9 100644 RtlFreeUnicodeString( &dirW ); if (status != STATUS_SUCCESS) goto done; diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 0b8c28a0651..e48cd84cffd 100644 +index 51d989f30b45..8f1653b0d626 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c -@@ -2469,7 +2469,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, +@@ -2521,7 +2521,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm, attr.ObjectName = nt_name; attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; @@ -63,10 +63,10 @@ index 0b8c28a0651..e48cd84cffd 100644 FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE ))) { diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c -index 0d0c1194d23..a1bf219ed0a 100644 +index 15ccdeb2e637..928edcb04e2c 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c -@@ -661,7 +661,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) +@@ -660,7 +660,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) return STATUS_NO_MEMORY; valueW.Length = NTDLL_swprintf( valueW.Buffer, pathfmtW, dir, name ) * sizeof(WCHAR); InitializeObjectAttributes( &attr, &valueW, 0, 0, NULL ); @@ -75,7 +75,7 @@ index 0d0c1194d23..a1bf219ed0a 100644 if (!status) TRACE( "found %s\n", debugstr_w( valueW.Buffer )); RtlFreeUnicodeString( &valueW ); if (status != STATUS_OBJECT_NAME_NOT_FOUND && status != STATUS_OBJECT_PATH_NOT_FOUND) return status; -@@ -685,7 +685,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) +@@ -684,7 +684,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file ) wcscat( valueW.Buffer, name ); valueW.Length = wcslen(valueW.Buffer) * sizeof(WCHAR); InitializeObjectAttributes( &attr, &valueW, 0, 0, NULL ); @@ -85,10 +85,10 @@ index 0d0c1194d23..a1bf219ed0a 100644 } RtlFreeUnicodeString( &valueW ); diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 2e791b92f73..f8170793185 100644 +index 9091d1ae8c77..f8e81ae49eaf 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h -@@ -350,4 +350,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) +@@ -329,4 +329,12 @@ static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) while (len--) *dst++ = (unsigned char)*src++; } @@ -102,7 +102,7 @@ index 2e791b92f73..f8170793185 100644 + #endif diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c -index 32e1f951af5..71ae44dd498 100644 +index 32e1f951af5c..71ae44dd4988 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -1020,7 +1020,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir) @@ -115,10 +115,10 @@ index 32e1f951af5..71ae44dd498 100644 if (nts != STATUS_SUCCESS) goto out; diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c -index 60ee39765bf..70dfe6f768a 100644 +index 884141da060c..32a1f5107f06 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c -@@ -1281,7 +1281,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, ULONG attributes, +@@ -1357,7 +1357,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, ULONG attributes, memset( info, 0, sizeof(*info) ); InitializeObjectAttributes( &attr, path, attributes, 0, 0 );