Rebase against 12c3177ed5cae39de8a9f9111a1cb450296cc8e6.

This commit is contained in:
Zebediah Figura
2020-04-01 18:08:55 -05:00
parent 001ea51fb5
commit 755d1ca559
12 changed files with 172 additions and 235 deletions

View File

@@ -1,4 +1,4 @@
From 0dbb12f12b3637dbf512cd0c0d719c901d57e63d Mon Sep 17 00:00:00 2001
From cc13b2bb6b823df3de62dfacabeff22ebb2cf93e 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: [PATCH] winebuild: Generate syscall thunks for ntdll exports.
@@ -17,10 +17,10 @@ Based on a patch by Erich E. Hoover.
9 files changed, 206 insertions(+), 27 deletions(-)
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 93eb142ab3f..5542d4b5e8e 100644
index ba127c00361..915b344aabe 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -427,6 +427,9 @@ static size_t signal_stack_size;
@@ -481,6 +481,9 @@ static ULONG first_ldt_entry = 32;
static wine_signal_handler handlers[256];
@@ -30,7 +30,7 @@ index 93eb142ab3f..5542d4b5e8e 100644
enum i386_trap_code
{
TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */
@@ -1448,7 +1451,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi,
@@ -1512,7 +1515,7 @@ NTSTATUS CDECL DECLSPEC_HIDDEN __regs_NtGetContextThread( DWORD edi, DWORD esi,
{
context->Ebp = ebp;
context->Esp = (DWORD)&retaddr;
@@ -39,19 +39,19 @@ index 93eb142ab3f..5542d4b5e8e 100644
context->SegCs = wine_get_cs();
context->SegSs = wine_get_ss();
context->EFlags = eflags;
@@ -2335,6 +2338,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -2599,6 +2602,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
*teb = addr;
(*teb)->Tib.Self = &(*teb)->Tib;
(*teb)->Tib.ExceptionList = (void *)~0UL;
+ (*teb)->WOW32Reserved = __wine_syscall_dispatcher;
thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2;
if (!(thread_data->fs = wine_ldt_alloc_fs()))
if (!(thread_data->fs = ldt_alloc_fs( *teb, first_thread )))
{
diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index ada28c91ebd..3ed8fa08213 100644
index 249ba9d7c39..b10e2f65553 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -1651,6 +1651,8 @@ static void test_thread_context(void)
@@ -1643,6 +1643,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 ada28c91ebd..3ed8fa08213 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 2351df010b0..68bceddef68 100644
index 7ab105752df..e469012b236 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -357,7 +357,7 @@ typedef struct _TEB
@@ -359,7 +359,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 2351df010b0..68bceddef68 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 43a0dd20e82..eb63b661c7f 100644
index 65493ec37fb..b701f0660e4 100644
--- a/tools/winebuild/build.h
+++ b/tools/winebuild/build.h
@@ -105,6 +105,7 @@ typedef struct
@@ -112,7 +112,7 @@ index 43a0dd20e82..eb63b661c7f 100644
#define FLAG_CPU_MASK (FLAG_CPU(CPU_LAST + 1) - FLAG_CPU(0))
#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64) | FLAG_CPU(CPU_ARM64))
#define FLAG_CPU_WIN32 (FLAG_CPU_MASK & ~FLAG_CPU_WIN64)
@@ -325,6 +330,8 @@ extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 );
@@ -326,6 +331,8 @@ extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 );
extern int parse_spec_file( FILE *file, DLLSPEC *spec );
extern int parse_def_file( FILE *file, DLLSPEC *spec );
@@ -122,10 +122,10 @@ index 43a0dd20e82..eb63b661c7f 100644
extern int byte_swapped;
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 8c32b738a23..599281674f2 100644
index 04ab433dd65..0c6bafed8e5 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -541,6 +541,7 @@ static void check_undefined_forwards( DLLSPEC *spec )
@@ -531,6 +531,7 @@ static void check_undefined_forwards( DLLSPEC *spec )
/* flag the dll exports that link to an undefined symbol */
static void check_undefined_exports( DLLSPEC *spec )
{
@@ -133,7 +133,7 @@ index 8c32b738a23..599281674f2 100644
int i;
for (i = 0; i < spec->nb_entry_points; i++)
@@ -548,7 +549,8 @@ static void check_undefined_exports( DLLSPEC *spec )
@@ -538,7 +539,8 @@ static void check_undefined_exports( DLLSPEC *spec )
ORDDEF *odp = &spec->entry_points[i];
if (odp->type == TYPE_STUB || odp->type == TYPE_ABS || odp->type == TYPE_VARIABLE) continue;
if (odp->flags & FLAG_FORWARD) continue;
@@ -143,7 +143,7 @@ index 8c32b738a23..599281674f2 100644
{
switch(odp->type)
{
@@ -559,14 +561,14 @@ static void check_undefined_exports( DLLSPEC *spec )
@@ -549,14 +551,14 @@ static void check_undefined_exports( DLLSPEC *spec )
if (link_ext_symbols)
{
odp->flags |= FLAG_EXT_LINK;
@@ -162,10 +162,10 @@ index 8c32b738a23..599281674f2 100644
}
}
diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 3191efaf9ea..f440881a0ec 100644
index be705c25f0f..004b6aea7ab 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -541,6 +541,24 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
@@ -543,6 +543,24 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
}
@@ -190,7 +190,7 @@ index 3191efaf9ea..f440881a0ec 100644
/*******************************************************************
* parse_spec_ordinal
*
@@ -616,6 +634,14 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
@@ -618,6 +636,14 @@ static int parse_spec_ordinal( int ordinal, DLLSPEC *spec )
assert( 0 );
}
@@ -205,7 +205,7 @@ index 3191efaf9ea..f440881a0ec 100644
if ((odp->flags & FLAG_CPU_MASK) && !(odp->flags & FLAG_CPU(target_cpu)))
{
/* ignore this entry point */
@@ -813,6 +839,37 @@ static void assign_ordinals( DLLSPEC *spec )
@@ -815,6 +841,37 @@ static void assign_ordinals( DLLSPEC *spec )
}
@@ -243,7 +243,7 @@ index 3191efaf9ea..f440881a0ec 100644
/*******************************************************************
* add_16bit_exports
*
@@ -914,6 +971,8 @@ int parse_spec_file( FILE *file, DLLSPEC *spec )
@@ -916,6 +973,8 @@ int parse_spec_file( FILE *file, DLLSPEC *spec )
current_line = 0; /* no longer parsing the input file */
assign_names( spec );
assign_ordinals( spec );
@@ -293,10 +293,10 @@ index 3a7e457282a..a179175b8c1 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 855e6d8739f..119e1079940 100644
index ecfe4c50113..fa7984e1a38 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -371,6 +371,109 @@ static void output_relay_debug( DLLSPEC *spec )
@@ -374,6 +374,109 @@ static void output_relay_debug( DLLSPEC *spec )
}
}
@@ -406,7 +406,7 @@ index 855e6d8739f..119e1079940 100644
/*******************************************************************
* output_exports
*
@@ -767,6 +870,7 @@ void output_spec32_file( DLLSPEC *spec )
@@ -770,6 +873,7 @@ void output_spec32_file( DLLSPEC *spec )
open_output_file();
output_standard_file_header();
output_module( spec );
@@ -415,10 +415,10 @@ index 855e6d8739f..119e1079940 100644
output_exports( spec );
output_imports( spec );
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index 31a6b283713..74fc8a16bcf 100644
index be877080486..63aeeca4468 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -838,6 +838,7 @@ void free_dll_spec( DLLSPEC *spec )
@@ -854,6 +854,7 @@ void free_dll_spec( DLLSPEC *spec )
free( odp->name );
free( odp->export_name );
free( odp->link_name );
@@ -426,7 +426,7 @@ index 31a6b283713..74fc8a16bcf 100644
}
free( spec->file_name );
free( spec->dll_name );
@@ -847,6 +848,7 @@ void free_dll_spec( DLLSPEC *spec )
@@ -863,6 +864,7 @@ void free_dll_spec( DLLSPEC *spec )
free( spec->names );
free( spec->ordinals );
free( spec->resources );
@@ -434,7 +434,7 @@ index 31a6b283713..74fc8a16bcf 100644
free( spec );
}
@@ -1265,3 +1267,22 @@ const char *get_asm_string_section(void)
@@ -1281,3 +1283,22 @@ const char *get_asm_string_section(void)
default: return ".section .rodata";
}
}
@@ -458,5 +458,5 @@ index 31a6b283713..74fc8a16bcf 100644
+ return j + 1;
+}
--
2.20.1
2.26.0

View File

@@ -1,4 +1,4 @@
From 4855e0338f57525304221ba1c29c3926a9f16263 Mon Sep 17 00:00:00 2001
From ef002efad2f2ef4fcbc9aab1a91acaccdb7a846e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 15 May 2017 16:27:56 +0200
Subject: [PATCH] winebuild: Add stub functions in fake dlls.
@@ -61,10 +61,10 @@ index e72dea9ca51..bf3cf00f964 100644
CloseHandle(map);
CloseHandle(file);
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index a0f8b3a2ec6..72285f0b456 100644
index 915b344aabe..8cb19f68ec1 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -445,6 +445,39 @@ static wine_signal_handler handlers[256];
@@ -484,6 +484,39 @@ static wine_signal_handler handlers[256];
extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void );
extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context );
@@ -104,16 +104,16 @@ index a0f8b3a2ec6..72285f0b456 100644
enum i386_trap_code
{
TRAP_x86_UNKNOWN = -1, /* Unknown fault (TRAP_sig not defined) */
@@ -2307,6 +2340,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
@@ -2603,6 +2636,7 @@ NTSTATUS signal_alloc_thread( TEB **teb )
(*teb)->Tib.Self = &(*teb)->Tib;
(*teb)->Tib.ExceptionList = (void *)~0UL;
(*teb)->WOW32Reserved = __wine_syscall_dispatcher;
+ (*teb)->Spare2 = __wine_fakedll_dispatcher;
thread_data = (struct x86_thread_data *)(*teb)->SystemReserved2;
if (!(thread_data->fs = wine_ldt_alloc_fs()))
if (!(thread_data->fs = ldt_alloc_fs( *teb, first_thread )))
{
diff --git a/include/winternl.h b/include/winternl.h
index 1fbf05b0125..f44722093ba 100644
index e469012b236..24a41a9f95d 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -398,7 +398,7 @@ typedef struct _TEB
@@ -436,5 +436,5 @@ index b0be1b594b3..b1e34c5da18 100644
{
size_t size = align - (output_buffer_pos % align);
--
2.25.1
2.26.0