Commit 746d900b authored by Alexandre Julliard's avatar Alexandre Julliard

Force minimum stack size to 1Mb for Xlib.

parent 76adb1ff
......@@ -62,6 +62,7 @@ TEB *THREAD_InitStack( TEB *teb, DWORD stack_size )
void *base;
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 )))
return NULL;
......
......@@ -259,6 +259,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
}
if (stack_reserve < stack_commit) stack_reserve = stack_commit;
stack_reserve = (stack_reserve + 0xffff) & ~0xffff; /* round to 64K boundary */
if (stack_reserve < 1024 * 1024) stack_reserve = 1024 * 1024; /* Xlib needs a large stack */
info->stack_base = NULL;
info->stack_size = stack_reserve;
......
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