From 298a46acbf39eff14bfe9a193b04c7b5f2a67350 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Mon, 17 Dec 2018 20:11:59 +0200 Subject: [PATCH] [NTUSER] Don't crash when the current thread doesn't have a desktop --- win32ss/user/ntuser/scrollex.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/win32ss/user/ntuser/scrollex.c b/win32ss/user/ntuser/scrollex.c index dd3b1d47f06..c344cec9475 100644 --- a/win32ss/user/ntuser/scrollex.c +++ b/win32ss/user/ntuser/scrollex.c @@ -14,20 +14,17 @@ static HWND FASTCALL co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags) { - PDESKTOP Desktop; PTHRDCARETINFO CaretInfo; PTHREADINFO pti; - PUSER_MESSAGE_QUEUE ActiveMessageQueue; + PUSER_MESSAGE_QUEUE ThreadQueue; HWND hWndCaret; PWND WndCaret; ASSERT_REFS_CO(Window); pti = PsGetCurrentThreadWin32Thread(); - Desktop = pti->rpdesk; - ActiveMessageQueue = Desktop->ActiveMessageQueue; - if (!ActiveMessageQueue) return 0; - CaretInfo = &ActiveMessageQueue->CaretInfo; + ThreadQueue = pti->MessageQueue; + CaretInfo = &ThreadQueue->CaretInfo; hWndCaret = CaretInfo->hWnd; WndCaret = ValidateHwndNoErr(hWndCaret);