Author: tkreuzer
Date: Fri Aug 20 19:24:48 2010
New Revision: 48576
URL:
http://svn.reactos.org/svn/reactos?rev=48576&view=rev
Log:
[WIN32K]
- 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
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Fri Aug 20
19:24:48 2010
@@ -579,14 +579,20 @@
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)
{
@@ -625,10 +631,6 @@
UserDerefObjectCo(DesktopWindow);
}
}
- }
- else
- {
- *HitTest = HTCLIENT;
}
if ( gspv.bMouseClickLock &&
@@ -800,6 +802,8 @@
* WM_TIMER messages
*/
CheckMessages:
+
+ HitTest = HTNOWHERE;
Present = FALSE;