Module: wine Branch: master Commit: c00c62bbfdb85eb2e2ecc545b6eee838e5a481f7 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c00c62bbfdb85eb2e2ecc545b...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Apr 1 11:25:48 2021 +0200
ntdll: Create the initial stack on the Unix side.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/loader.c | 6 ------ dlls/ntdll/unix/loader.c | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 336b11c6344..e418eef6acb 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4020,7 +4020,6 @@ static void map_wow64cpu(void) */ static NTSTATUS process_init(void) { - INITIAL_TEB stack; TEB *teb = NtCurrentTeb(); PEB *peb = teb->Peb;
@@ -4069,11 +4068,6 @@ static NTSTATUS process_init(void) map_wow64cpu(); } #endif - - RtlCreateUserStack( 0, 0, 0, 0x10000, 0x10000, &stack ); - teb->Tib.StackBase = stack.StackBase; - teb->Tib.StackLimit = stack.StackLimit; - teb->DeallocationStack = stack.DeallocationStack; return STATUS_SUCCESS; }
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 5b0004b6d01..1d3a940aab8 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1797,6 +1797,7 @@ static struct unix_funcs unix_funcs = static void start_main_thread(void) { NTSTATUS status; + INITIAL_TEB stack; TEB *teb = virtual_alloc_first_teb();
signal_init_threading(); @@ -1809,6 +1810,10 @@ static void start_main_thread(void) syscall_dispatcher = signal_init_syscalls(); init_files(); init_startup_info(); + virtual_alloc_thread_stack( &stack, 0, 0, NULL ); + teb->Tib.StackBase = stack.StackBase; + teb->Tib.StackLimit = stack.StackLimit; + teb->DeallocationStack = stack.DeallocationStack; NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 ); load_ntdll(); load_libwine();