2014-04-29 0:04 GMT+08:00 Piotr Caban <piotr.caban(a)gmail.com>:
On 04/28/14 17:26, Shuai Meng wrote:
2014-04-21 17:18 GMT+08:00 Jacek Caban <jacek(a)codeweavers.com <mailto:jacek(a)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.
I've fixed this, but another problem appears. I put my new patch in the attachment, along with the test result of wine. It fails when tested in wine, while normal in my windows. I can't understand, this patch is almost the same with the previous one.