[ros-dev] [ros-diffs] [tkreuzer] 48576: [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 ProcessMou

Monkey Libre monkey.libre at gmail.com
Sat Aug 21 13:51:39 UTC 2010


2010/8/20, tkreuzer at svn.reactos.org <tkreuzer at svn.reactos.org>:
> 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/ntuser/message.c?rev=48576&r1=48575&r2=48576&view=diff
> ==============================================================================
> --- 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;
>
>
>
>


-- 
My translator and tester profile:
https://launchpad.net/~monkey-libre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkq9LEMACgkQY9l6fYUypMPuvACeIZFzQSH3yxMy4wHpQpjK5y9t
l34An2b5eHl/hA/AaB8GKbJczM2v0UcT
=4iFN
-----END PGP SIGNATURE-----



More information about the Ros-dev mailing list