ntoskrnl.exe: Open thread with THREAD_QUERY_INFORMATION access in KeGetCurrentThread.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-04-12 15:20:28 +02:00 committed by Alexandre Julliard
parent 7d351e1168
commit 2017db7d0a
1 changed files with 2 additions and 1 deletions

View File

@ -2510,7 +2510,8 @@ PRKTHREAD WINAPI KeGetCurrentThread(void)
HANDLE handle = GetCurrentThread();
/* FIXME: we shouldn't need it, GetCurrentThread() should be client thread already */
if (GetCurrentThreadId() == request_thread) handle = OpenThread( 0, FALSE, client_tid );
if (GetCurrentThreadId() == request_thread)
handle = OpenThread( THREAD_QUERY_INFORMATION, FALSE, client_tid );
kernel_object_from_handle( handle, PsThreadType, (void**)&thread );
if (handle != GetCurrentThread()) NtClose( handle );