[PATCH 01/10] vbscript: Fixed CBool(try 3)

Piotr Caban piotr.caban at gmail.com
Mon Apr 28 11:04:15 CDT 2014


On 04/28/14 17:26, Shuai Meng wrote:
>
>
>
> 2014-04-21 17:18 GMT+08:00 Jacek Caban <jacek at codeweavers.com
> <mailto:jacek at codeweavers.com>>:
>
>     Hi Shuai,
>
>     On 04/21/14 03:45, Shuai Meng wrote:
>      > -
>      > -    return return_bool(res, val);
>      > +    V_VT(res) = VT_EMPTY;
>      > +    return VariantChangeType(res, arg, VARIANT_LOCALBOOL, VT_BOOL);
>
>     You can't assume that res is not NULL. If result of the function is not
>     used, it will be NULL. A simple test case is like this:
>
>     call CBool(0)
>
>     Also, are you sure we want VARIANT_LOCALBOOL here? Did you test it
>     (probably by running tests on localized Windows with translated string
>     "False")?
>
>   I don't quite understand what this parameter means, in fact I just
> copy it from to_string(). If not VARIANT_LOCALBOOL, waht esle should be
> filled here?

I've checked what happens on non-english locale and CStr(True) = "True". 
So the flag is used incorrectly in CStr implementation. CBool is also 
failing when localized string is passed.

You can use 0 as flag in VariantChangeType.



More information about the wine-devel mailing list