Commit 5aacee95 authored by Alex Villacís Lasso's avatar Alex Villacís Lasso Committed by Alexandre Julliard

oleaut32: Support for VT_DISPATCH in VarXor.

parent e98a49de
......@@ -4520,6 +4520,7 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
{
VARTYPE vt;
VARIANT varLeft, varRight;
VARIANT tempLeft, tempRight;
double d;
HRESULT hRet;
......@@ -4542,6 +4543,23 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
return S_OK;
}
VariantInit(&tempLeft);
VariantInit(&tempRight);
/* Handle VT_DISPATCH by storing and taking address of returned value */
if ((V_VT(pVarLeft) & VT_TYPEMASK) == VT_DISPATCH)
{
hRet = VARIANT_FetchDispatchValue(pVarLeft, &tempLeft);
if (FAILED(hRet)) goto VarXor_Exit;
pVarLeft = &tempLeft;
}
if ((V_VT(pVarRight) & VT_TYPEMASK) == VT_DISPATCH)
{
hRet = VARIANT_FetchDispatchValue(pVarRight, &tempRight);
if (FAILED(hRet)) goto VarXor_Exit;
pVarRight = &tempRight;
}
/* Copy our inputs so we don't disturb anything */
V_VT(&varLeft) = V_VT(&varRight) = VT_EMPTY;
......@@ -4576,7 +4594,10 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
if (V_VT(&varLeft) == VT_I8 || V_VT(&varRight) == VT_I8)
{
if (V_VT(pVarLeft) == VT_INT || V_VT(pVarRight) == VT_INT)
return DISP_E_TYPEMISMATCH;
{
hRet = DISP_E_TYPEMISMATCH;
goto VarXor_Exit;
}
vt = VT_I8;
}
else
......@@ -4654,6 +4675,8 @@ HRESULT WINAPI VarXor(LPVARIANT pVarLeft, LPVARIANT pVarRight, LPVARIANT pVarOut
VarXor_Exit:
VariantClear(&varLeft);
VariantClear(&varRight);
VariantClear(&tempLeft);
VariantClear(&tempRight);
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