wine-staging/patches/ntdll-SystemRecommendedSharedDataAlignment/0002-ntdll-Implement-SystemRecommendedSharedDataAlignment.patch

71 lines
2.1 KiB
Diff

From f5437d47185217d5c82ae09301ad92a6d22e55c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 21 Jan 2016 00:30:31 +0100
Subject: ntdll: Implement SystemRecommendedSharedDataAlignment class in
NtQuerySystemInformation.
---
dlls/ntdll/nt.c | 11 +++++++++++
dlls/ntdll/tests/info.c | 16 ++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 9ee1923..e28b21f 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -2155,6 +2155,17 @@ NTSTATUS WINAPI NtQuerySystemInformation(
RtlFreeHeap(GetProcessHeap(), 0, buf);
}
break;
+ case SystemRecommendedSharedDataAlignment:
+ {
+ len = sizeof(DWORD);
+ if (Length >= len)
+ {
+ if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION;
+ else *((DWORD *)SystemInformation) = 64;
+ }
+ else ret = STATUS_INFO_LENGTH_MISMATCH;
+ }
+ break;
default:
FIXME("(0x%08x,%p,0x%08x,%p) stub\n",
SystemInformationClass,SystemInformation,Length,ResultLength);
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 252736e..e8ad0bf 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1929,6 +1929,19 @@ static void test_thread_start_address(void)
CloseHandle(thread);
}
+static void test_query_data_alignment(void)
+{
+ ULONG ReturnLength;
+ NTSTATUS status;
+ DWORD value;
+
+ value = 0xdeadbeef;
+ 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);
+ ok(value == 64, "Expected 64, got %u\n", value);
+}
+
START_TEST(info)
{
char **argv;
@@ -1995,6 +2008,9 @@ START_TEST(info)
test_query_logicalproc();
test_query_logicalprocex();
+ trace("Starting test_query_data_alignment()\n");
+ test_query_data_alignment();
+
/* NtPowerInformation */
/* 0xb ProcessorInformation */
--
2.6.4