mscoree: COM cleanup in corruntimehost.c.
This commit is contained in:
parent
39d4656b2a
commit
e79e6e30f4
|
@ -45,8 +45,8 @@ DEFINE_GUID(IID__AppDomain, 0x05f696dc,0x2b29,0x3663,0xad,0x8b,0xc4,0x38,0x9c,0x
|
||||||
|
|
||||||
struct RuntimeHost
|
struct RuntimeHost
|
||||||
{
|
{
|
||||||
const struct ICorRuntimeHostVtbl *lpVtbl;
|
ICorRuntimeHost ICorRuntimeHost_iface;
|
||||||
const struct ICLRRuntimeHostVtbl *lpCLRHostVtbl;
|
ICLRRuntimeHost ICLRRuntimeHost_iface;
|
||||||
const CLRRuntimeInfo *version;
|
const CLRRuntimeInfo *version;
|
||||||
loaded_mono *mono;
|
loaded_mono *mono;
|
||||||
struct list domains;
|
struct list domains;
|
||||||
|
@ -207,12 +207,12 @@ static HRESULT RuntimeHost_GetIUnknownForDomain(RuntimeHost *This, MonoDomain *d
|
||||||
|
|
||||||
static inline RuntimeHost *impl_from_ICLRRuntimeHost( ICLRRuntimeHost *iface )
|
static inline RuntimeHost *impl_from_ICLRRuntimeHost( ICLRRuntimeHost *iface )
|
||||||
{
|
{
|
||||||
return (RuntimeHost *)((char*)iface - FIELD_OFFSET(RuntimeHost, lpCLRHostVtbl));
|
return CONTAINING_RECORD(iface, RuntimeHost, ICLRRuntimeHost_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline RuntimeHost *impl_from_ICorRuntimeHost( ICorRuntimeHost *iface )
|
static inline RuntimeHost *impl_from_ICorRuntimeHost( ICorRuntimeHost *iface )
|
||||||
{
|
{
|
||||||
return (RuntimeHost *)((char*)iface - FIELD_OFFSET(RuntimeHost, lpVtbl));
|
return CONTAINING_RECORD(iface, RuntimeHost, ICorRuntimeHost_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** IUnknown methods ***/
|
/*** IUnknown methods ***/
|
||||||
|
@ -476,13 +476,13 @@ static HRESULT WINAPI CLRRuntimeHost_QueryInterface(ICLRRuntimeHost* iface,
|
||||||
static ULONG WINAPI CLRRuntimeHost_AddRef(ICLRRuntimeHost* iface)
|
static ULONG WINAPI CLRRuntimeHost_AddRef(ICLRRuntimeHost* iface)
|
||||||
{
|
{
|
||||||
RuntimeHost *This = impl_from_ICLRRuntimeHost( iface );
|
RuntimeHost *This = impl_from_ICLRRuntimeHost( iface );
|
||||||
return IUnknown_AddRef((IUnknown*)&This->lpVtbl);
|
return ICorRuntimeHost_AddRef(&This->ICorRuntimeHost_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI CLRRuntimeHost_Release(ICLRRuntimeHost* iface)
|
static ULONG WINAPI CLRRuntimeHost_Release(ICLRRuntimeHost* iface)
|
||||||
{
|
{
|
||||||
RuntimeHost *This = impl_from_ICLRRuntimeHost( iface );
|
RuntimeHost *This = impl_from_ICLRRuntimeHost( iface );
|
||||||
return IUnknown_Release((IUnknown*)&This->lpVtbl);
|
return ICorRuntimeHost_Release(&This->ICorRuntimeHost_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI CLRRuntimeHost_Start(ICLRRuntimeHost* iface)
|
static HRESULT WINAPI CLRRuntimeHost_Start(ICLRRuntimeHost* iface)
|
||||||
|
@ -794,8 +794,8 @@ HRESULT RuntimeHost_Construct(const CLRRuntimeInfo *runtime_version,
|
||||||
if ( !This )
|
if ( !This )
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
This->lpVtbl = &corruntimehost_vtbl;
|
This->ICorRuntimeHost_iface.lpVtbl = &corruntimehost_vtbl;
|
||||||
This->lpCLRHostVtbl = &CLRHostVtbl;
|
This->ICLRRuntimeHost_iface.lpVtbl = &CLRHostVtbl;
|
||||||
This->ref = 1;
|
This->ref = 1;
|
||||||
This->version = runtime_version;
|
This->version = runtime_version;
|
||||||
This->mono = loaded_mono;
|
This->mono = loaded_mono;
|
||||||
|
@ -816,12 +816,12 @@ HRESULT RuntimeHost_GetInterface(RuntimeHost *This, REFCLSID clsid, REFIID riid,
|
||||||
|
|
||||||
if (IsEqualGUID(clsid, &CLSID_CorRuntimeHost))
|
if (IsEqualGUID(clsid, &CLSID_CorRuntimeHost))
|
||||||
{
|
{
|
||||||
unk = (IUnknown*)&This->lpVtbl;
|
unk = (IUnknown*)&This->ICorRuntimeHost_iface;
|
||||||
IUnknown_AddRef(unk);
|
IUnknown_AddRef(unk);
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(clsid, &CLSID_CLRRuntimeHost))
|
else if (IsEqualGUID(clsid, &CLSID_CLRRuntimeHost))
|
||||||
{
|
{
|
||||||
unk = (IUnknown*)&This->lpCLRHostVtbl;
|
unk = (IUnknown*)&This->ICLRRuntimeHost_iface;
|
||||||
IUnknown_AddRef(unk);
|
IUnknown_AddRef(unk);
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(clsid, &CLSID_CorMetaDataDispenser) ||
|
else if (IsEqualGUID(clsid, &CLSID_CorMetaDataDispenser) ||
|
||||||
|
|
Loading…
Reference in New Issue