ntdll: Create the initial stack on the Unix side.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-04-01 11:25:48 +02:00
parent 29d9659095
commit c00c62bbfd
2 changed files with 5 additions and 6 deletions

View File

@ -4020,7 +4020,6 @@ static void map_wow64cpu(void)
*/ */
static NTSTATUS process_init(void) static NTSTATUS process_init(void)
{ {
INITIAL_TEB stack;
TEB *teb = NtCurrentTeb(); TEB *teb = NtCurrentTeb();
PEB *peb = teb->Peb; PEB *peb = teb->Peb;
@ -4069,11 +4068,6 @@ static NTSTATUS process_init(void)
map_wow64cpu(); map_wow64cpu();
} }
#endif #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; return STATUS_SUCCESS;
} }

View File

@ -1797,6 +1797,7 @@ static struct unix_funcs unix_funcs =
static void start_main_thread(void) static void start_main_thread(void)
{ {
NTSTATUS status; NTSTATUS status;
INITIAL_TEB stack;
TEB *teb = virtual_alloc_first_teb(); TEB *teb = virtual_alloc_first_teb();
signal_init_threading(); signal_init_threading();
@ -1809,6 +1810,10 @@ static void start_main_thread(void)
syscall_dispatcher = signal_init_syscalls(); syscall_dispatcher = signal_init_syscalls();
init_files(); init_files();
init_startup_info(); 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 ); NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
load_ntdll(); load_ntdll();
load_libwine(); load_libwine();