May 9, 2026
5:06 p.m.
ICreateTypeInfo2_fnLayOut starts cbSizeVft at 7*ptr_size for TKIND_DISPATCH to position own funcs after the IDispatch vtbl, then increments per added func. The own funcs receive correct oVft offsets that way, but the resulting stored cbSizeVft is too large by exactly the IDispatch vtbl size: GetTypeAttr later derives cFuncs as cbSizeVft/ptr_size and so reports own_count + 7 instead of own_count. Subtract the prefix at the end of LayOut so cFuncs matches native, both in-memory and after SaveAllChanges + LoadTypeLibEx. Public cbSizeVft is unchanged: GetTypeAttr already overrides it to sizeof(IDispatchVtbl). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10856