Added patch to implement SystemRecommendedSharedDataAlignment class in NtQuerySystemInformation.

This commit is contained in:
Sebastian Lackner 2016-01-22 17:43:29 +01:00
parent 35a2b6a62a
commit e6cdf018d3
4 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,70 @@
From 8ffb502a5289e9bd56ae02d292f19c67b94e2b19 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:28:15 +0100
Subject: include: Add more constants to SYSTEM_INFORMATION_CLASS.
---
include/winternl.h | 46 +++++++++++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/include/winternl.h b/include/winternl.h
index 3494c00..e665a47 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -822,26 +822,34 @@ typedef enum _SYSTEM_INFORMATION_CLASS {
SystemVerifierInformation = 51,
SystemAddVerifier = 52,
SystemSessionProcessesInformation = 53,
- Unknown54,
- Unknown55,
- Unknown56,
- Unknown57,
- Unknown58,
- Unknown59,
- Unknown60,
- Unknown61,
- Unknown62,
- Unknown63,
- Unknown64,
- Unknown65,
- Unknown66,
- Unknown67,
- Unknown68,
- Unknown69,
- Unknown70,
- Unknown71,
- Unknown72,
+ SystemLoadGdiDriverInSystemSpace = 54,
+ SystemNumaProcessorMap = 55,
+ SystemPrefetcherInformation = 56,
+ SystemExtendedProcessInformation = 57,
+ SystemRecommendedSharedDataAlignment = 58,
+ SystemComPlusPackage = 59,
+ SystemNumaAvailableMemory = 60,
+ SystemProcessorPowerInformation = 61,
+ SystemEmulationBasicInformation = 62,
+ SystemEmulationProcessorInformation = 63,
+ SystemExtendedHandleInformation = 64,
+ SystemLostDelayedWriteInformation = 65,
+ SystemBigPoolInformation = 66,
+ SystemSessionPoolTagInformation = 67,
+ SystemSessionMappedViewInformation = 68,
+ SystemHotpatchInformation = 69,
+ SystemObjectSecurityMode = 70,
+ SystemWatchdogTimerHandler = 71,
+ SystemWatchdogTimerInformation = 72,
SystemLogicalProcessorInformation = 73,
+ SystemWow64SharedInformation = 74,
+ SystemRegisterFirmwareTableInformationHandler = 75,
+ SystemFirmwareTableInformation = 76,
+ SystemModuleInformationEx = 77,
+ SystemVerifierTriageInformation = 78,
+ SystemSuperfetchInformation = 79,
+ SystemMemoryListInformation = 80,
+ SystemFileCacheInformationEx = 81,
SystemLogicalProcessorInformationEx = 107,
SystemInformationClassMax
} SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
--
2.6.4

View File

@ -0,0 +1,70 @@
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

View File

@ -0,0 +1 @@
Fixes: Implement SystemRecommendedSharedDataAlignment class in NtQuerySystemInformation

View File

@ -221,6 +221,7 @@ patch_enable_all ()
enable_ntdll_Status_Mapping="$1"
enable_ntdll_Syscall_Wrappers="$1"
enable_ntdll_SystemInterruptInformation="$1"
enable_ntdll_SystemRecommendedSharedDataAlignment="$1"
enable_ntdll_SystemRoot_Symlink="$1"
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
@ -801,6 +802,9 @@ patch_enable ()
ntdll-SystemInterruptInformation)
enable_ntdll_SystemInterruptInformation="$2"
;;
ntdll-SystemRecommendedSharedDataAlignment)
enable_ntdll_SystemRecommendedSharedDataAlignment="$2"
;;
ntdll-SystemRoot_Symlink)
enable_ntdll_SystemRoot_Symlink="$2"
;;
@ -4824,6 +4828,20 @@ if test "$enable_ntdll_SystemInterruptInformation" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-SystemRecommendedSharedDataAlignment
# |
# | Modified files:
# | * dlls/ntdll/nt.c, dlls/ntdll/tests/info.c, include/winternl.h
# |
if test "$enable_ntdll_SystemRecommendedSharedDataAlignment" -eq 1; then
patch_apply ntdll-SystemRecommendedSharedDataAlignment/0001-include-Add-more-constants-to-SYSTEM_INFORMATION_CLA.patch
patch_apply ntdll-SystemRecommendedSharedDataAlignment/0002-ntdll-Implement-SystemRecommendedSharedDataAlignment.patch
(
echo '+ { "Michael Müller", "include: Add more constants to SYSTEM_INFORMATION_CLASS.", 1 },';
echo '+ { "Michael Müller", "ntdll: Implement SystemRecommendedSharedDataAlignment class in NtQuerySystemInformation.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-SystemRoot_Symlink
# |
# | This patchset has the following (direct or indirect) dependencies: