[PATCH 2/2] ntdll/tests: Allow the initial process parameters size to be aligned.

Zebediah Figura z.figura12 at gmail.com
Tue Jan 19 21:51:59 CST 2021


This fixes a common test failure on Wine.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/ntdll/tests/env.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c
index d476bd65a81..72bc45cfad4 100644
--- a/dlls/ntdll/tests/env.c
+++ b/dlls/ntdll/tests/env.c
@@ -537,7 +537,9 @@ static void test_process_params(void)
         while (*str) str += lstrlenW(str) + 1;
         str++;
     }
-    ok( (char *)str == (char *)cur_params + cur_params->Size,
+    /* windows doesn't align size for the initial block, but wine does */
+    ok( (UINT_PTR)str == (UINT_PTR)cur_params + cur_params->Size ||
+        align((UINT_PTR)str, sizeof(void *)) == (UINT_PTR)cur_params + cur_params->Size,
         "wrong end ptr %p/%p\n", str, (char *)cur_params + cur_params->Size );
 
     /* initial environment is a separate block */
-- 
2.29.2




More information about the wine-devel mailing list