Ensure that GetSystemMenu returns valid HMENU unless bRevert specified

Paul Vriens paul.vriens.wine at gmail.com
Wed Jul 1 03:18:09 CDT 2009


Brent Roman wrote:
> Originally submitted on 6/14/09.
> Resubmitted after comments on this bug:
> 
> http://bugs.winehq.org/show_bug.cgi?id=19134
> 
> The attached patch against the master branch (as of today) fixes what 
> appears to be a long standing bug in Wine's
> GetSystemMenu function in User32.dll.so.
> 
> GetSystemMenu() is always supposed to return a valid HMENU handle, but 
> the logic in Wine's version would return nil in some cases where windows 
> would return an HMENU.  Specifically, when the relevant windows dwStyle 
> mask did not include WS_SYSMENU, wine would return nil, but windows 
> would still return a valid HMENU.
> 
> To reproduce the bug:
> 
> 1.  Download and install the Quadravox AQ430 development tools from:
>     http://www.quadravox.com/AQ430.htm
> http://appdb.winehq.org/objectManager.php?sClass=application&iId=9939
> 
> 2.  Attempt to compile any 'C' source file.
> 
> Before applying the patch, all such attempts will quickly fail with an 
> invalid read from address 0x4.
> 
> After applying the patch, compilations complete without (internal) 
> errors.  It is allow possible to download binaries to
> the microcontroller via the TI Flash Emulator Tool under linux
> as this hardware appears to the linux kernel 2.6.30 as a serial
> port.  (Yea!)
> 
> I've been using the app heavily for a couple days now without problems.  
> In fact, it runs faster and uses much less memory under Wine than 
> Win4Lin or VMplayer!  Very nice.
> 
> I do not subscribe to this list, so please email me directly if you have 
> any questions or concerns.
> 
> - brent
> 
>  mailto:brent at mbari.org  http://www.mbari.org/~brent
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
Hi Brent,

No comments on the real content of the patch other than you most likely 
will need to write one or more testcases to show your patch is correct.

Please stick to the indentation and style of the file (surrounding code):

- 4 space indentation instead of 2 space
- curly brackets on separate lines
- there are some tabs in this piece of the code, while you're at it you 
could change it to use 4 spaces instead.

-- 
Cheers,

Paul.



More information about the wine-devel mailing list