PATCH for Bugs 1844 and 1845

Andreas Rosenberg sonix2003 at ctf-z.de
Thu Dec 4 18:04:40 CST 2003


1844: Point Size in DLG_TEMPLATE may be negative (with DS_SETFONT)

Within Windows the pointSize parameter (for the FONT in the DLG_TEMPLATE 
struct) may be a signed 16-bit integer. With WINE this integers get's 
converted to an unsigned int resulting in huge font for the dialog. The size 
of the dialog is being computed based on this font and results in invalid 
parameters for CreateWindow, that may cause a termination of WINE. We detected 
this problem testing our software with WINE.  


1845: Return values of CharUpperA and CharLowerA

The return values for CharUpperA and CharUpperB should return 32-bit ints with 
the upper 16 bits being 0 if the operand is a single character. Passing single 
characters with the 8th-bit being set, may result in 32bit results with the 
upper 16 bits set. This may confuse apps taking the whole 32bit value. We 
detected this bug, while testing our software with WINE. 
 
The problem seems to lie in dlls/user/lstr.c  (sign extension problem?). 
 
Looking at the code in lstr.c I saw a SetLastError. This may destroy a 
SetLastError of another call. Here is an excerpt from the Microsoft 
documentation for this call: 
------------ 
The CharUpper function converts a character string or a single character to 
uppercase. If the operand is a character string, the function converts the 
characters in place.  
.... 
There is no indication of success or failure. Failure is rare. There is no 
extended error information for this function; do not call GetLastError. 
(which implies that this function should NOT call SetLastError)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 3697 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20031205/badccd68/attachment.obj


More information about the wine-patches mailing list