When a dispinterface isn't dual, we should return
TYPE_E_ELEMENTNOTFOUND when trying to get index -1.
This commit is contained in:
parent
fc94b1c72c
commit
284687a621
|
@ -4338,7 +4338,8 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(
|
||||||
HREFTYPE *pRefType)
|
HREFTYPE *pRefType)
|
||||||
{
|
{
|
||||||
ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
|
ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
|
||||||
int(i);
|
int i;
|
||||||
|
HRESULT hr = S_OK;
|
||||||
TLBImplType *pImpl = This->impltypelist;
|
TLBImplType *pImpl = This->impltypelist;
|
||||||
|
|
||||||
TRACE("(%p) index %d\n", This, index);
|
TRACE("(%p) index %d\n", This, index);
|
||||||
|
@ -4358,8 +4359,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!pImpl) return TYPE_E_ELEMENTNOTFOUND;
|
hr = TYPE_E_ELEMENTNOTFOUND;
|
||||||
*pRefType = pImpl->hRef;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4370,15 +4370,21 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(
|
||||||
pImpl = pImpl->next;
|
pImpl = pImpl->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pImpl) return TYPE_E_ELEMENTNOTFOUND;
|
if (pImpl)
|
||||||
|
*pRefType = pImpl->hRef;
|
||||||
*pRefType = pImpl->hRef;
|
else
|
||||||
|
hr = TYPE_E_ELEMENTNOTFOUND;
|
||||||
TRACE("-- 0x%08lx\n", pImpl->hRef );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
if(TRACE_ON(ole))
|
||||||
|
{
|
||||||
|
if(SUCCEEDED(hr))
|
||||||
|
TRACE("SUCCESS -- hRef = 0x%08lx\n", *pRefType );
|
||||||
|
else
|
||||||
|
TRACE("FAILURE -- hresult = 0x%08lx\n", hr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITypeInfo::GetImplTypeFlags
|
/* ITypeInfo::GetImplTypeFlags
|
||||||
|
|
Loading…
Reference in New Issue