rpcrt4: Write type format strings for coclasses.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=19016 Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cb8353b6e8
commit
5d44b1d4bd
@ -324,6 +324,32 @@ static size_t write_ip_tfs(unsigned char *str, size_t *len, const GUID *iid)
|
|||||||
return off;
|
return off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void get_default_iface(ITypeInfo *typeinfo, WORD count, GUID *iid)
|
||||||
|
{
|
||||||
|
ITypeInfo *refinfo;
|
||||||
|
HREFTYPE reftype;
|
||||||
|
TYPEATTR *attr;
|
||||||
|
int flags, i;
|
||||||
|
|
||||||
|
for (i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
ITypeInfo_GetImplTypeFlags(typeinfo, i, &flags);
|
||||||
|
if (flags & IMPLTYPEFLAG_FDEFAULT)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If no interface was explicitly marked default, choose the first one. */
|
||||||
|
if (i == count)
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
ITypeInfo_GetRefTypeOfImplType(typeinfo, i, &reftype);
|
||||||
|
ITypeInfo_GetRefTypeInfo(typeinfo, reftype, &refinfo);
|
||||||
|
ITypeInfo_GetTypeAttr(refinfo, &attr);
|
||||||
|
*iid = attr->guid;
|
||||||
|
ITypeInfo_ReleaseTypeAttr(refinfo, attr);
|
||||||
|
ITypeInfo_Release(refinfo);
|
||||||
|
}
|
||||||
|
|
||||||
static size_t write_pointer_tfs(ITypeInfo *typeinfo, unsigned char *str,
|
static size_t write_pointer_tfs(ITypeInfo *typeinfo, unsigned char *str,
|
||||||
size_t *len, TYPEDESC *desc, BOOL toplevel, BOOL onstack)
|
size_t *len, TYPEDESC *desc, BOOL toplevel, BOOL onstack)
|
||||||
{
|
{
|
||||||
@ -331,6 +357,7 @@ static size_t write_pointer_tfs(ITypeInfo *typeinfo, unsigned char *str,
|
|||||||
size_t ref, off = *len;
|
size_t ref, off = *len;
|
||||||
ITypeInfo *refinfo;
|
ITypeInfo *refinfo;
|
||||||
TYPEATTR *attr;
|
TYPEATTR *attr;
|
||||||
|
GUID guid;
|
||||||
|
|
||||||
if (desc->vt == VT_USERDEFINED)
|
if (desc->vt == VT_USERDEFINED)
|
||||||
{
|
{
|
||||||
@ -358,6 +385,10 @@ static size_t write_pointer_tfs(ITypeInfo *typeinfo, unsigned char *str,
|
|||||||
case TKIND_DISPATCH:
|
case TKIND_DISPATCH:
|
||||||
write_ip_tfs(str, len, &attr->guid);
|
write_ip_tfs(str, len, &attr->guid);
|
||||||
break;
|
break;
|
||||||
|
case TKIND_COCLASS:
|
||||||
|
get_default_iface(refinfo, attr->cImplTypes, &guid);
|
||||||
|
write_ip_tfs(str, len, &guid);
|
||||||
|
break;
|
||||||
case TKIND_ALIAS:
|
case TKIND_ALIAS:
|
||||||
off = write_pointer_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack);
|
off = write_pointer_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user