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.
2014-06-25 17:32 GMT+08:00 Piotr Caban piotr.caban@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?
On 06/25/14 15:34, Shuai Meng wrote:
2014-06-25 17:32 GMT+08:00 Piotr Caban <piotr.caban@gmail.com mailto:piotr.caban@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.
2014-06-25 21:44 GMT+08:00 Piotr Caban piotr.caban@gmail.com:
On 06/25/14 15:34, Shuai Meng wrote:
2014-06-25 17:32 GMT+08:00 Piotr Caban <piotr.caban@gmail.com mailto:piotr.caban@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.