Force minimum stack size to 1Mb for Xlib.

This commit is contained in:
Alexandre Julliard 2003-11-18 00:14:17 +00:00
parent 76adb1ff0d
commit 746d900b04
2 changed files with 2 additions and 0 deletions

View file

@ -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;

View file

@ -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;