ntdll-SystemModuleInformation: Add patchset.

This commit is contained in:
Zebediah Figura 2018-08-09 14:25:29 -05:00
parent 0e828a225e
commit af0347a0f2
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,50 @@
From ee3f09c31baedd50ab53179249b482eb51fcb0f3 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Mon, 6 Aug 2018 21:32:56 -0500
Subject: [PATCH] ntdll: Don't call LdrQueryProcessModuleInformation in
NtQuerySystemInformation(SystemModuleInformation).
Based on a patch by Andrew Wesie.
This is simply incorrect; this function should only list kernel drivers.
This makes the anticheat engine in League of Legends 8.15+ happy.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45550
---
dlls/ntdll/nt.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index af22e58..80d3ef8 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -2493,9 +2493,22 @@ NTSTATUS WINAPI NtQuerySystemInformation(
}
break;
case SystemModuleInformation:
- /* FIXME: should be system-wide */
- if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION;
- else ret = LdrQueryProcessModuleInformation( SystemInformation, Length, &len );
+ if (!SystemInformation)
+ ret = STATUS_ACCESS_VIOLATION;
+ else if (Length < FIELD_OFFSET( SYSTEM_MODULE_INFORMATION, Modules[1] ))
+ {
+ len = FIELD_OFFSET( SYSTEM_MODULE_INFORMATION, Modules[1] );
+ ret = STATUS_INFO_LENGTH_MISMATCH;
+ }
+ else
+ {
+ SYSTEM_MODULE_INFORMATION *smi = SystemInformation;
+
+ FIXME("returning fake driver list\n");
+ smi->ModulesCount = 1;
+ memset(&smi->Modules[0], 0, sizeof(smi->Modules[0]));
+ ret = STATUS_SUCCESS;
+ }
break;
case SystemHandleInformation:
{
--
2.7.4

View File

@ -0,0 +1 @@
Fixes: [45550] League of Legends 8.15+ anticheat fails due to incorrect implementation of NtQuerySystemInformation(SystemModuleInformation)

View File

@ -249,6 +249,7 @@ patch_enable_all ()
enable_ntdll_Stack_Overflow="$1"
enable_ntdll_Status_Mapping="$1"
enable_ntdll_SystemInterruptInformation="$1"
enable_ntdll_SystemModuleInformation="$1"
enable_ntdll_SystemRoot_Symlink="$1"
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
@ -932,6 +933,9 @@ patch_enable ()
ntdll-SystemInterruptInformation)
enable_ntdll_SystemInterruptInformation="$2"
;;
ntdll-SystemModuleInformation)
enable_ntdll_SystemModuleInformation="$2"
;;
ntdll-SystemRoot_Symlink)
enable_ntdll_SystemRoot_Symlink="$2"
;;
@ -5775,6 +5779,22 @@ if test "$enable_ntdll_SystemInterruptInformation" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-SystemModuleInformation
# |
# | This patchset fixes the following Wine bugs:
# | * [#45550] League of Legends 8.15+ anticheat fails due to incorrect implementation of
# | NtQuerySystemInformation(SystemModuleInformation)
# |
# | Modified files:
# | * dlls/ntdll/nt.c
# |
if test "$enable_ntdll_SystemModuleInformation" -eq 1; then
patch_apply ntdll-SystemModuleInformation/0001-ntdll-Don-t-call-LdrQueryProcessModuleInformation-in.patch
(
printf '%s\n' '+ { "Zebediah Figura", "ntdll: Don'\''t call LdrQueryProcessModuleInformation in NtQuerySystemInformation(SystemModuleInformation).", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-SystemRoot_Symlink
# |
# | This patchset has the following (direct or indirect) dependencies: