[PATCH 1/2] rpcrt4: Add support for TKIND_INTERFACE, TKIND_DISPATCH, TKIND_COCLASS to write_type_tfs.
z.figura12 at gmail.com
Wed Mar 18 23:18:59 CDT 2020
On 3/18/20 9:46 PM, Dmitry Timoshkov wrote:
> Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
> dlls/rpcrt4/ndr_typelib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/dlls/rpcrt4/ndr_typelib.c b/dlls/rpcrt4/ndr_typelib.c
> index c90c60c7b8..c2eb660cc1 100644
> --- a/dlls/rpcrt4/ndr_typelib.c
> +++ b/dlls/rpcrt4/ndr_typelib.c
> @@ -811,7 +811,7 @@ static size_t write_type_tfs(ITypeInfo *typeinfo, unsigned char *str,
> case TKIND_INTERFACE:
> case TKIND_DISPATCH:
> case TKIND_COCLASS:
> - assert(0);
> + off = write_pointer_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack);
> case TKIND_ALIAS:
> off = write_type_tfs(refinfo, str, len, &attr->tdescAlias, toplevel, onstack);
I did some deeper testing, and I don't think this is correct.
tdescAlias is only set for TKIND_DISPATCH, and it points to VT_DISPATCH
(presumably because any dispatchable interface doubles as IDispatch
itself). For TKIND_INTERFACE and TKIND_COCLASS it's clear, and that will
result in write_pointer_tfs trying to write VT_EMPTY.
Instead, I think we just want to duplicate the contents of
write_pointer_tfs here, i.e. write "desc" as if it were a pointer. Does
the attached patch work for you?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7561 bytes
Desc: not available
More information about the wine-devel