- co_IntTranslateMouseMessage: properly initialize *HitTest and only send WM_NCHITTEST when the message is going to be removed
- co_IntPeekMessage: Prevent possible use of uninitialized HitTest by ProcessMouseMessage()
- Patch by Jan Roeloffzen [jroeloffzen at hotmail dot com]
- Fixes bug 2139

svn path=/trunk/; revision=48576
This commit is contained in:
Timo Kreuzer 2010-08-20 19:24:48 +00:00
parent ca4003c9f8
commit 02cb45ab9c

View file

@ -579,14 +579,20 @@ co_IntTranslateMouseMessage(
return TRUE;
}
*HitTest = HTCLIENT;
UserRefObjectCo(Window, &Ref);
if ( ThreadQueue == Window->pti->MessageQueue &&
ThreadQueue->CaptureWindow != Window->hSelf)
{
/* only send WM_NCHITTEST messages if we're not capturing the window! */
*HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0,
MAKELONG(Msg->pt.x, Msg->pt.y));
if (Remove )
{
*HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0,
MAKELONG(Msg->pt.x, Msg->pt.y));
}
/* else we are going to see this message again, but then with Remove == TRUE */
if (*HitTest == (USHORT)HTTRANSPARENT)
{
@ -626,10 +632,6 @@ co_IntTranslateMouseMessage(
}
}
}
else
{
*HitTest = HTCLIENT;
}
if ( gspv.bMouseClickLock &&
( (Msg->message == WM_LBUTTONUP) ||
@ -801,6 +803,8 @@ co_IntPeekMessage( PUSER_MESSAGE Msg,
*/
CheckMessages:
HitTest = HTNOWHERE;
Present = FALSE;
KeQueryTickCount(&LargeTickCount);