mirror of
https://github.com/reactos/reactos.git
synced 2024-06-26 07:51:52 +00:00
[NTUSER] Don't crash when the current thread doesn't have a desktop
This commit is contained in:
parent
b2a5f5dbb3
commit
298a46acbf
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue