Commit 789c1db1 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Allocate TEBs and stacks in the low 2G.

parent 6a9e1934
......@@ -2907,7 +2907,7 @@ TEB *virtual_alloc_first_teb(void)
exit(1);
}
NtAllocateVirtualMemory( NtCurrentProcess(), &teb_block, 0, &total,
NtAllocateVirtualMemory( NtCurrentProcess(), &teb_block, is_win64 ? 0x7fffffff : 0, &total,
MEM_RESERVE | MEM_TOP_DOWN, PAGE_READWRITE );
teb_block_pos = 30;
ptr = (char *)teb_block + 30 * block_size;
......@@ -2944,8 +2944,8 @@ NTSTATUS virtual_alloc_teb( TEB **ret_teb )
{
SIZE_T total = 32 * block_size;
if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, 0, &total,
MEM_RESERVE, PAGE_READWRITE )))
if ((status = NtAllocateVirtualMemory( NtCurrentProcess(), &ptr, is_win64 ? 0x7fffffff : 0,
&total, MEM_RESERVE, PAGE_READWRITE )))
{
server_leave_uninterrupted_section( &virtual_mutex, &sigset );
return status;
......@@ -3060,7 +3060,7 @@ NTSTATUS virtual_alloc_thread_stack( INITIAL_TEB *stack, SIZE_T reserve_size, SI
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
if ((status = map_view( &view, NULL, size + extra_size, FALSE,
VPROT_READ | VPROT_WRITE | VPROT_COMMITTED, 0 )) != STATUS_SUCCESS)
VPROT_READ | VPROT_WRITE | VPROT_COMMITTED, 33 )) != STATUS_SUCCESS)
goto done;
#ifdef VALGRIND_STACK_REGISTER
......
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