Jacek Caban (@jacek) commented about dlls/mshtml/dispex.c:
+ TRACE("%s (%p)->(%lx %d %lx %p %p %p %p)\n", This->info->name, This, id, iid, flags, dp, ret, ei, caller);
hres = get_builtin_func(This->info, id, &func); - if(FAILED(hres) || func->tid != iid) + if(FAILED(hres)) return E_UNEXPECTED;
+ if(iid <= 0) { + if(func->tid != -iid) + return E_UNEXPECTED; + }else if(iid != desc->id) { + while(iid != desc->prototype_id) { + if(!desc->prototype_id) + return E_UNEXPECTED; + desc = object_descriptors[desc->prototype_id]; + } Lookup shouldn't be needed here, I think we could store function's prototype id in `func_info_t`, like `on_prototype`.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/7779#note_100632