[PATCH] rpcrt4: Fix getting underlying typeinfo of IDispatch.
Porot Mo
porotmjp at gmail.com
Sun Jun 14 22:14:55 CDT 2020
Signed-off-by: Porot Mo <porotmjp at gmail.com>
---
dlls/rpcrt4/ndr_typelib.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200615/0f48d56a/attachment.htm>
-------------- next part --------------
diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
index f1f2588..9365e0b 100644
--- a/dlls/rpcrt4/ndr_typelib.c
+++ b/dlls/rpcrt4/ndr_typelib.c
@@ -1229,6 +1229,7 @@ static HRESULT get_iface_info(ITypeInfo *typeinfo, WORD *funcs, WORD *parentfunc
HREFTYPE reftype;
SYSKIND syskind;
HRESULT hr;
+ WORD typeflags;
/* Dual interfaces report their size to be sizeof(IDispatchVtbl) and their
* implemented type to be IDispatch. We need to retrieve the underlying
@@ -1237,10 +1238,15 @@ static HRESULT get_iface_info(ITypeInfo *typeinfo, WORD *funcs, WORD *parentfunc
if (FAILED(hr))
return hr;
typekind = typeattr->typekind;
+ typeflags = typeattr->wTypeFlags;
ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr);
if (typekind == TKIND_DISPATCH)
{
- hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype);
+ if (typeflags & TYPEFLAG_FDUAL)
+ hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype);
+ else
+ hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, &reftype);
+
if (FAILED(hr))
return hr;
More information about the wine-devel
mailing list