[PATCH 1/2] ntdll/tests: Check that creating huge thread stacks should work.

Rémi Bernon rbernon at codeweavers.com
Fri May 7 05:08:04 CDT 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

I'm not completely sure what 789c1db18a4e192425da3771cac4726cda77130b
was for, but it seems to be causing spurious failures. This fix is
trying to keep the current behavior, but it may be better to completely
revert the commit as, although less likely, TEB allocation could also
fail much more often.

 dlls/ntdll/tests/virtual.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
index 8f5b0092bea..686b4076801 100644
--- a/dlls/ntdll/tests/virtual.c
+++ b/dlls/ntdll/tests/virtual.c
@@ -488,6 +488,11 @@ static DWORD WINAPI test_stack_size_thread(void *ptr)
     return 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 );
@@ -563,6 +568,11 @@ static void test_RtlCreateUserStack(void)
     thread = CreateThread(NULL, 0x3ff000, test_stack_size_thread, &args, STACK_SIZE_PARAM_IS_A_RESERVATION, NULL);
     WaitForSingleObject(thread, INFINITE);
     CloseHandle(thread);
+
+    thread = CreateThread(NULL, 0x80000000, test_stack_size_dummy_thread, NULL, STACK_SIZE_PARAM_IS_A_RESERVATION, NULL);
+    todo_wine ok(thread != NULL, "CreateThread with huge stack failed\n");
+    WaitForSingleObject(thread, INFINITE);
+    CloseHandle(thread);
 }
 
 static void test_NtMapViewOfSection(void)
-- 
2.31.0




More information about the wine-devel mailing list