Commit 60b3d30f authored by Alexandre Julliard's avatar Alexandre Julliard

Don't require execute permission for thread stacks.

parent 04f9f1b0
......@@ -93,7 +93,7 @@ LPVOID WINAPI CreateFiberEx( SIZE_T stack_commit, SIZE_T stack_reserve, DWORD fl
/* FIXME: should use the thread stack allocation routines here */
if (!stack_reserve) stack_reserve = 1024*1024;
if(!(fiber->stack_allocation = VirtualAlloc( 0, stack_reserve, MEM_COMMIT, PAGE_EXECUTE_READWRITE )))
if(!(fiber->stack_allocation = VirtualAlloc( 0, stack_reserve, MEM_COMMIT, PAGE_READWRITE )))
{
HeapFree( GetProcessHeap(), 0, fiber );
return NULL;
......
......@@ -66,7 +66,7 @@ TEB *THREAD_InitStack( TEB *teb, DWORD stack_size )
stack_size = (stack_size + (page_size - 1)) & ~(page_size - 1);
if (stack_size < 1024 * 1024) stack_size = 1024 * 1024; /* Xlib needs a large stack */
if (!(base = VirtualAlloc( NULL, stack_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE )))
if (!(base = VirtualAlloc( NULL, stack_size, MEM_COMMIT, PAGE_READWRITE )))
return NULL;
teb->DeallocationStack = base;
......@@ -75,7 +75,7 @@ TEB *THREAD_InitStack( TEB *teb, DWORD stack_size )
/* Setup guard pages */
VirtualProtect( base, 1, PAGE_EXECUTE_READWRITE | PAGE_GUARD, &old_prot );
VirtualProtect( base, 1, PAGE_READWRITE | PAGE_GUARD, &old_prot );
return teb;
}
......
......@@ -192,7 +192,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
size = info->stack_size;
teb->DeallocationStack = info->stack_base;
NtAllocateVirtualMemory( NtCurrentProcess(), &teb->DeallocationStack, 0,
&size, MEM_SYSTEM, PAGE_EXECUTE_READWRITE );
&size, MEM_SYSTEM, PAGE_READWRITE );
/* limit is lower than base since the stack grows down */
teb->Tib.StackBase = (char *)info->stack_base + info->stack_size;
teb->Tib.StackLimit = info->stack_base;
......@@ -200,7 +200,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
/* setup the guard page */
size = 1;
NtProtectVirtualMemory( NtCurrentProcess(), &teb->DeallocationStack, &size,
PAGE_EXECUTE_READWRITE | PAGE_GUARD, NULL );
PAGE_READWRITE | PAGE_GUARD, NULL );
RtlFreeHeap( GetProcessHeap(), 0, info );
RtlAcquirePebLock();
......
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