[PATCH] ntdll: Fix SystemRecommendedSharedDataAlignment on ARM

André Hentschel nerv at dawncrow.de
Sun May 17 08:54:33 CDT 2020


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43961
Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
 dlls/ntdll/nt.c         | 9 ++++++++-
 dlls/ntdll/tests/info.c | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 4dced316418..20768065732 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -3034,7 +3034,14 @@ NTSTATUS WINAPI NtQuerySystemInformation(
             if (Length >= len)
             {
                 if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION;
-                else *((DWORD *)SystemInformation) = 64;
+                else
+                {
+#ifdef __arm__
+                    *((DWORD *)SystemInformation) = 32;
+#else
+                    *((DWORD *)SystemInformation) = 64;
+#endif
+                }
             }
             else ret = STATUS_INFO_LENGTH_MISMATCH;
         }
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 7a641f8b84e..b591f39cead 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -2518,7 +2518,11 @@ static void test_query_data_alignment(void)
     status = pNtQuerySystemInformation(SystemRecommendedSharedDataAlignment, &value, sizeof(value), &ReturnLength);
     ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
     ok(sizeof(value) == ReturnLength, "Inconsistent length %u\n", ReturnLength);
+#ifdef __arm__
+    ok(value == 32, "Expected 32, got %u\n", value);
+#else
     ok(value == 64, "Expected 64, got %u\n", value);
+#endif
 }
 
 static void test_thread_lookup(void)
-- 
2.17.1



More information about the wine-devel mailing list