mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[NTUSER] Add locking at IntSendFocusMessage (#4468)
Fix access violation on IntFocusSetInputContext. - Add locking on pWndPrev. CORE-18163
This commit is contained in:
parent
74efe979a8
commit
0b0e73d66e
|
@ -617,6 +617,7 @@ IntSendFocusMessages( PTHREADINFO pti, PWND pWnd)
|
||||||
PWND pWndPrev;
|
PWND pWndPrev;
|
||||||
PUSER_MESSAGE_QUEUE ThreadQueue = pti->MessageQueue; // Queue can change...
|
PUSER_MESSAGE_QUEUE ThreadQueue = pti->MessageQueue; // Queue can change...
|
||||||
HWND hwndPrev;
|
HWND hwndPrev;
|
||||||
|
USER_REFERENCE_ENTRY Ref;
|
||||||
|
|
||||||
ThreadQueue->QF_flags &= ~QF_FOCUSNULLSINCEACTIVE;
|
ThreadQueue->QF_flags &= ~QF_FOCUSNULLSINCEACTIVE;
|
||||||
if (!pWnd && ThreadQueue->spwndActive)
|
if (!pWnd && ThreadQueue->spwndActive)
|
||||||
|
@ -625,6 +626,8 @@ IntSendFocusMessages( PTHREADINFO pti, PWND pWnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
pWndPrev = ThreadQueue->spwndFocus;
|
pWndPrev = ThreadQueue->spwndFocus;
|
||||||
|
if (pWndPrev)
|
||||||
|
UserRefObjectCo(pWndPrev, &Ref);
|
||||||
|
|
||||||
/* check if the specified window can be set in the input data of a given queue */
|
/* check if the specified window can be set in the input data of a given queue */
|
||||||
if (!pWnd || ThreadQueue == pWnd->head.pti->MessageQueue)
|
if (!pWnd || ThreadQueue == pWnd->head.pti->MessageQueue)
|
||||||
|
@ -667,6 +670,9 @@ IntSendFocusMessages( PTHREADINFO pti, PWND pWnd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pWndPrev)
|
||||||
|
UserDerefObjectCo(pWndPrev);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
|
|
Loading…
Reference in a new issue