jscript: Added support for VT_I2 in disp_propget.
This commit is contained in:
parent
9700e9c7a6
commit
b6a1912392
|
@ -958,6 +958,15 @@ jsdisp_t *iface_to_jsdisp(IUnknown *iface)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void ensure_retval_type(VARIANT *v)
|
||||
{
|
||||
switch(V_VT(v)) {
|
||||
case VT_I2:
|
||||
V_VT(v) = VT_I4;
|
||||
V_I4(v) = V_I2(v);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID *id)
|
||||
{
|
||||
dispex_prop_t *prop;
|
||||
|
@ -1203,18 +1212,21 @@ HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, VARIANT *val
|
|||
}
|
||||
|
||||
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
|
||||
if(FAILED(hres)) {
|
||||
ULONG err = 0;
|
||||
|
||||
TRACE("using IDispatch\n");
|
||||
return IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, INVOKE_PROPERTYGET, &dp, val, &ei->ei, &err);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, INVOKE_PROPERTYGET, &dp, val, &ei->ei,
|
||||
&ctx->jscaller->IServiceProvider_iface);
|
||||
IDispatchEx_Release(dispex);
|
||||
}else {
|
||||
ULONG err = 0;
|
||||
|
||||
TRACE("using IDispatch\n");
|
||||
hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, INVOKE_PROPERTYGET, &dp, val, &ei->ei, &err);
|
||||
}
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
ensure_retval_type(val);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
|
||||
|
|
Loading…
Reference in New Issue