ntdll/tests: Check that creating huge thread stacks works.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-05-07 12:08:04 +02:00 committed by Alexandre Julliard
parent 6f9562db20
commit b44fb883b0
1 changed files with 13 additions and 0 deletions

View File

@ -488,6 +488,11 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
ExitThread(0);
}
static DWORD WINAPI test_stack_size_dummy_thread(void *ptr)
{
return 0;
}
static void test_RtlCreateUserStack(void)
{
IMAGE_NT_HEADERS *nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress );
@ -565,6 +570,14 @@ static void test_RtlCreateUserStack(void)
WaitForSingleObject(thread, INFINITE);
CloseHandle(thread);
if (is_win64)
{
thread = CreateThread(NULL, 0x80000000, test_stack_size_dummy_thread, NULL, STACK_SIZE_PARAM_IS_A_RESERVATION, NULL);
ok(thread != NULL, "CreateThread with huge stack failed\n");
WaitForSingleObject(thread, INFINITE);
CloseHandle(thread);
}
args.expect_committed = default_commit < 0x2000 ? 0x2000 : default_commit;
args.expect_reserved = 0x100000;
for (i = 0; i < 32; i++)