oleaut32: Add wrapper for dereferencing a VARIANT of type VT_DISPATCH and returning the VARIANT value.

This commit is contained in:
Alex Villacís Lasso 2007-01-02 18:48:10 -05:00 committed by Alexandre Julliard
parent 3a463f039b
commit 4245cbb31c
1 changed files with 16 additions and 0 deletions

View File

@ -2856,6 +2856,22 @@ HRESULT WINAPI VarCmp(LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags)
#undef _VARCMP
}
static HRESULT VARIANT_FetchDispatchValue(LPVARIANT pvDispatch, LPVARIANT pValue)
{
HRESULT hres;
static DISPPARAMS emptyParams = { NULL, NULL, 0, 0 };
if ((V_VT(pvDispatch) & VT_TYPEMASK) == VT_DISPATCH) {
if (NULL == V_DISPATCH(pvDispatch)) return DISP_E_TYPEMISMATCH;
hres = IDispatch_Invoke(V_DISPATCH(pvDispatch), DISPID_VALUE, &IID_NULL,
LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &emptyParams, pValue,
NULL, NULL);
} else {
hres = DISP_E_TYPEMISMATCH;
}
return hres;
}
/**********************************************************************
* VarAnd [OLEAUT32.142]
*