mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[NTUSER] Don't crash when the current thread doesn't have a desktop
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user