From 29cc0422576f93bb032e966ae107b7cf9d717695 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 20 Nov 2019 18:54:23 -0600 Subject: [PATCH] ntdll-ThreadHideFromDebugger: Add patch. --- ...ryInformationThread-ThreadHideFromDe.patch | 28 +++++++++++++++++++ .../ntdll-ThreadHideFromDebugger/definition | 1 + patches/patchinstall.sh | 19 +++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch create mode 100644 patches/ntdll-ThreadHideFromDebugger/definition diff --git a/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch b/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch new file mode 100644 index 00000000..addc320e --- /dev/null +++ b/patches/ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch @@ -0,0 +1,28 @@ +From 39813f58fc654ecd12f9ce5cf0d6e356e2e81697 Mon Sep 17 00:00:00 2001 +From: David Torok +Date: Tue, 19 Nov 2019 23:01:46 +0100 +Subject: [PATCH] ntdll: Stub NtQueryInformationThread(ThreadHideFromDebugger). + +--- + dlls/ntdll/thread.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index 621aaddfe..512b4814e 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -1115,6 +1115,11 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, + *(BOOL*)data = FALSE; + if (ret_len) *ret_len = sizeof(BOOL); + return STATUS_SUCCESS; ++ case ThreadHideFromDebugger: ++ if (length != sizeof(char)) return STATUS_INFO_LENGTH_MISMATCH; ++ *(BOOLEAN *)data = TRUE; ++ if (ret_len) *ret_len = sizeof(BOOLEAN); ++ return STATUS_SUCCESS; + case ThreadPriority: + case ThreadBasePriority: + case ThreadImpersonationToken: +-- +2.23.0 + diff --git a/patches/ntdll-ThreadHideFromDebugger/definition b/patches/ntdll-ThreadHideFromDebugger/definition new file mode 100644 index 00000000..24a72f4e --- /dev/null +++ b/patches/ntdll-ThreadHideFromDebugger/definition @@ -0,0 +1 @@ +Fixes: [48138] League of Legends 9.23: Crash after champ select diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 6a69960c..8e295a8a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -218,6 +218,7 @@ patch_enable_all () enable_ntdll_SystemInterruptInformation="$1" enable_ntdll_SystemModuleInformation="$1" enable_ntdll_SystemRoot_Symlink="$1" + enable_ntdll_ThreadHideFromDebugger="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_Threading="$1" enable_ntdll_User_Shared_Data="$1" @@ -776,6 +777,9 @@ patch_enable () ntdll-SystemRoot_Symlink) enable_ntdll_SystemRoot_Symlink="$2" ;; + ntdll-ThreadHideFromDebugger) + enable_ntdll_ThreadHideFromDebugger="$2" + ;; ntdll-ThreadTime) enable_ntdll_ThreadTime="$2" ;; @@ -5098,6 +5102,21 @@ if test "$enable_ntdll_SystemModuleInformation" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-ThreadHideFromDebugger +# | +# | This patchset fixes the following Wine bugs: +# | * [#48138] League of Legends 9.23: Crash after champ select +# | +# | Modified files: +# | * dlls/ntdll/thread.c +# | +if test "$enable_ntdll_ThreadHideFromDebugger" -eq 1; then + patch_apply ntdll-ThreadHideFromDebugger/0001-ntdll-Stub-NtQueryInformationThread-ThreadHideFromDe.patch + ( + printf '%s\n' '+ { "David Torok", "ntdll: Stub NtQueryInformationThread(ThreadHideFromDebugger).", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-Zero_mod_name # | # | Modified files: