[PATCH 2/4] vbscript: Implemented VarType(try 3)
Shuai Meng
mengshuaicalendr at gmail.com
Wed Jun 25 09:20:55 CDT 2014
2014-06-25 21:44 GMT+08:00 Piotr Caban <piotr.caban at gmail.com>:
> On 06/25/14 15:34, Shuai Meng wrote:
>
>> 2014-06-25 17:32 GMT+08:00 Piotr Caban <piotr.caban at gmail.com
>> <mailto:piotr.caban at gmail.com>>:
>>
>>
>> On 06/25/14 04:19, Shuai Meng wrote:
>>
>> static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg,
>> unsigned args_cnt, VARIANT *res)
>> {
>> - FIXME("\n");
>> - return E_NOTIMPL;
>> + TRACE("(%s)\n", debugstr_variant(arg));
>> +
>> + assert(args_cnt == 1);
>> +
>> + if(V_VT(arg) & ~VT_TYPEMASK) {
>> + FIXME("not supported %s\n", debugstr_variant(arg));
>> + return E_NOTIMPL;
>> + }
>> +
>> + if(!res)
>> + return DISP_E_BADVARTYPE;
>>
>> This function should not return error if res is NULL.
>>
>> But it returned error when res was NULL in CInt and other conversion
>> functions. Will you please explain this?
>>
> You need to implement it in the same way as on windows. A test for this
> behavior may be following:
> Call VarType(Empty)
> because the function is not returning error the script is executed
> successfully.
>
> In general functions are supposed to behave in the same way no matter if
> return value is used or not. Unfortunately there are some functions that
> behave differently.
>
>
> OK, I finally understand the secret, keep the same with windows.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20140625/bd8644fc/attachment.html>
More information about the wine-devel
mailing list