A big part of the Wine code doesn't follow the COM guideline. Most notably, there are many uses of the ICOM_MULTI_THIS or DEFINE_THIS technique. The plan is to get rid of them in favor of the standard implementation. To fix an existing interface implementation, we need to:
- Change vtbl pointer in object to interface instance. This change usually look like:
- IMyInterfaceVtbl *lpIMyInterfaceVtbl; + IMyInterface IMyInterface_iface;
and fix its vtbl initialization to follow the change- obj->lpIMyInterfaceVtbl = &MyInterfaceVtbl; + obj->IMyInterface_iface.lpVtbl = &MyInterfaceVtbl;
- Add impl_from_* functions.
- Replace all ICOM_MULTI_THIS and *_THIS occurrences to impl_from_* calls.
- Replace all object to interface casts to address of instance expressions, for example:
- *ppv = (IMyInterface*) &This->lpIMyInterfaceVtbl; + *ppv = &This->IMyInterface_iface;
as well as:- *ppv = (IMyInterface*)This; + *ppv = &This->IMyInterface_iface;
