jscript: Represent NULL VT_UNKNOWN VARIANT as NULL VT_DISPATCH.

This commit is contained in:
Jacek Caban 2014-03-19 13:15:14 +01:00 committed by Alexandre Julliard
parent f846312f46
commit 5cf20ceffd
2 changed files with 9 additions and 2 deletions

View File

@ -327,6 +327,9 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r)
*r = jsval_disp(disp);
return S_OK;
}
}else {
*r = jsval_disp(NULL);
return S_OK;
}
/* fall through */
default:

View File

@ -1156,7 +1156,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
return S_OK;
case DISPID_GLOBAL_TESTARGTYPES: {
VARIANT args[3];
VARIANT args[4];
DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0};
HRESULT hres;
@ -1190,6 +1190,8 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_INT(args+1) = 22;
V_VT(args+2) = VT_UNKNOWN;
V_UNKNOWN(args+2) = (IUnknown*)&testObj;
V_VT(args+3) = VT_UNKNOWN;
V_UNKNOWN(args+3) = NULL;
hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
@ -2140,10 +2142,12 @@ static BOOL run_tests(void)
CHECK_CALLED(global_propargput_i);
SET_EXPECT(global_testargtypes_i);
parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(d,i,s) {"
parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(nullunk,d,i,s) {"
" ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));"
" ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));"
" ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));"
" ok(getVT(nullunk) === 'VT_DISPATCH', 'getVT(nullunk) = ' + getVT(nullunk));"
" ok(nullunk === null, 'nullunk !== null');"
"});");
CHECK_CALLED(global_testargtypes_i);