user32: Do not allow a change of capture if the currently capture window is a menu unless explicitly specified (try2)

Peter Dons Tychsen donpedro at tdcadsl.dk
Fri Jan 8 21:11:48 CST 2010


Hello A.

I was afraid you were going to say that! :-)

My initial change actually did that, but then i ran into the problem
that i need the request to fail, but not set an error-code. I could
push/pop the current error code in user32 but that seemed a bit ugly. I
could also single out that error code and then only translate the
others. But what error code should be used then? Also seemed a bit ugly.

Instead i have added a new member to the response to check if the
request was "allowed". Seemed like the cleanest solution. Is this
acceptable?

I have attached a new patch which does this.

Thanks,

/pedro

On Fri, 2010-01-08 at 10:06 +0100, Alexandre Julliard wrote:
> Peter Dons Tychsen <donpedro at tdcadsl.dk> writes:
> 
> > @@ -85,6 +85,17 @@ BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret )
> >      HWND previous = 0;
> >      UINT flags = 0;
> >      BOOL ret;
> > +    GUITHREADINFO info;
> > +    if(!GetGUIThreadInfo(GetCurrentThreadId(), &info))
> > +    {
> > +        return FALSE;
> > +    }
> > +
> > +    /* if in menu mode, reject all requests to change focus, except if the menu bit is set */
> > +    if((info.flags & GUI_INMENUMODE) && !(gui_flags & GUI_INMENUMODE))
> > +    {
> > +        return FALSE;
> > +    }
> 
> This should be handled on the server side.
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu_capture_patch_attemp3_review.patch
Type: text/x-patch
Size: 9913 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100109/3c1e1382/attachment-0001.bin>


More information about the wine-devel mailing list