Skip to content

ITypeInfo is wrong #1463

@colejohnson66

Description

@colejohnson66

I'm trying to enumerate a TLB.

Actual behavior

ITypeInfo outputs incorrect pointer-indirection in method signatures:

void GetFuncDesc(uint index, out winmdroot.System.Com.FUNCDESC ppFuncDesc);
void GetVarDesc(uint index, out winmdroot.System.Com.VARDESC ppVarDesc);

If FUNCDESC and VARDESC were interfaces, this would be fine. But they're structs. Curiously, GetTypeAttr is generated correctly:

unsafe void GetTypeAttr(winmdroot.System.Com.TYPEATTR** ppTypeAttr);

Expected behavior

The correct level of indirection:

void GetFuncDesc(uint index, winmdroot.System.Com.FUNCDESC** ppFuncDesc);
void GetVarDesc(uint index, winmdroot.System.Com.VARDESC** ppVarDesc);

With "friendlier" out T* extension methods.

Repro steps

  1. NativeMethods.txt content:
ITypeInfo

Context

  • CsWin32 version: 0.3.205

Metadata

The metadata is correct (63.0.31-preview):

namespace Windows.Win32.System.Com;

[global::Windows.Win32.Foundation.Metadata.Guid(132097U, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70)]
[Documentation("https://learn.microsoft.com/windows/win32/api/oaidl/nn-oaidl-itypeinfo")]
public interface ITypeInfo : IUnknown
{
    [Documentation("https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypeinfo-gettypeattr")]
    unsafe HRESULT GetTypeAttr([Out] TYPEATTR** ppTypeAttr);
    [Documentation("https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypeinfo-gettypecomp")]
    unsafe HRESULT GetTypeComp([Out] ITypeComp* ppTComp);
    [Documentation("https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypeinfo-getfuncdesc")]
    unsafe HRESULT GetFuncDesc([In] uint index, [Out] FUNCDESC** ppFuncDesc);
    [Documentation("https://learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-itypeinfo-getvardesc")]
    unsafe HRESULT GetVarDesc([In] uint index, [Out] VARDESC** ppVarDesc);
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions