OLEAUT32: disallow negative zero in case of underflow

Alex Villaci­s Lasso a_villacis at palosanto.com
Wed Mar 23 11:17:04 CST 2005


This is the second patch made in an attempt to solve bug 2474 
(http://bugs.winehq.org/show_bug.cgi?id=2474).

The application MP3GainGui.exe (a GUI frontend for mp3gain, written in 
Visual Basic) exhibits several problems when run in Wine. The first one 
(inability to peek via recv() and 0-byte buffer) was addresed by a 
previous patch. The second problem is a cryptic "Runtime error 13 - Type 
mismatch" before the main GUI is displayed. This second problem cripples 
the GUI beyond usability (not even the menus work). Last night I traced 
the problem to the way an underflowing negative float was converted into 
a string. In case of negative underflow (-1e-400 or so), native oleaut32 
generates "0", Wine generates "-0" (a negative zero). This difference, 
coupled with some logic in the GUI which isolated the first character 
and tried to convert it to an integer, caused it to throw this 
exception. The bottom line is, negative zeroes should be disallowed in 
float to string conversions.

BTW, in Wine-20050310, the Float->Decimal conversion tests all fail, can 
somebody look into this?

Changelog:
* VarBstrFromReal now disallows negative zeroes. If one is found, it is 
replaced with a plain "0"
* Tests updated to check for this case

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-oleaut32-vartype-disallow-negative-zero.patch
Type: text/x-patch
Size: 1711 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050323/5446ddbf/wine-oleaut32-vartype-disallow-negative-zero.bin


More information about the wine-patches mailing list