https://git.reactos.org/?p=reactos.git;a=commitdiff;h=298a46acbf39eff14bfe9…
commit 298a46acbf39eff14bfe9a193b04c7b5f2a67350
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Mon Dec 17 20:11:59 2018 +0200
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Wed Dec 19 16:13:18 2018 +0200
[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 dd3b1d47f0..c344cec947 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);