Commit 3033e090 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Do not force 2G stack limit for the main thread of 64 bit process.

parent b3d25fbe
......@@ -2169,7 +2169,7 @@ static void start_main_thread(void)
if (p___wine_main_wargv) *p___wine_main_wargv = main_wargv;
*(ULONG_PTR *)&peb->CloudFileFlags = get_image_address();
set_load_order_app_name( main_wargv[0] );
init_thread_stack( teb, is_win64 ? 0x7fffffff : 0, 0, 0 );
init_thread_stack( teb, 0, 0, 0 );
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
load_ntdll();
if (main_image_info.Machine != current_machine) load_wow64_ntdll( main_image_info.Machine );
......
......@@ -1156,7 +1156,8 @@ NTSTATUS init_thread_stack( TEB *teb, ULONG_PTR zero_bits, SIZE_T reserve_size,
#ifdef _WIN64
/* 32-bit stack */
if ((status = virtual_alloc_thread_stack( &stack, zero_bits, reserve_size, commit_size, 0 )))
if ((status = virtual_alloc_thread_stack( &stack, zero_bits ? zero_bits : 0x7fffffff,
reserve_size, commit_size, 0 )))
return status;
wow_teb->Tib.StackBase = PtrToUlong( stack.StackBase );
wow_teb->Tib.StackLimit = PtrToUlong( stack.StackLimit );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment