Commit 7f84b91b authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

oleaut32: Support for VT_DISPATCH in VarNeg.

parent f1b44b36
......@@ -4797,10 +4797,20 @@ HRESULT WINAPI VarEqv(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
HRESULT WINAPI VarNeg(LPVARIANT pVarIn, LPVARIANT pVarOut)
{
HRESULT hRet = S_OK;
VARIANT temp;
VariantInit(&temp);
TRACE("(%p->(%s%s),%p)\n", pVarIn, debugstr_VT(pVarIn),
debugstr_VF(pVarIn), pVarOut);
/* Handle VT_DISPATCH by storing and taking address of returned value */
if ((V_VT(pVarIn) & VT_TYPEMASK) == VT_DISPATCH && ((V_VT(pVarIn) & ~VT_TYPEMASK) == 0))
{
hRet = VARIANT_FetchDispatchValue(pVarIn, &temp);
if (FAILED(hRet)) goto VarNeg_Exit;
pVarIn = &temp;
}
V_VT(pVarOut) = V_VT(pVarIn);
switch (V_VT(pVarIn))
......@@ -4872,8 +4882,10 @@ HRESULT WINAPI VarNeg(LPVARIANT pVarIn, LPVARIANT pVarOut)
else
hRet = DISP_E_TYPEMISMATCH;
}
VarNeg_Exit:
if (FAILED(hRet))
V_VT(pVarOut) = VT_EMPTY;
VariantClear(&temp);
return hRet;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment