Commit 65ff66a1 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

inetcomm: Use an iface instead of a vtbl pointer in cf.

parent 33883536
......@@ -72,13 +72,13 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
*/
typedef struct
{
const struct IClassFactoryVtbl *lpVtbl;
IClassFactory IClassFactory_iface;
HRESULT (*create_object)(IUnknown *, void **);
} cf;
static inline cf *impl_from_IClassFactory( IClassFactory *iface )
{
return (cf *)((char*)iface - FIELD_OFFSET(cf, lpVtbl));
return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
}
static HRESULT WINAPI cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
......@@ -141,11 +141,11 @@ static const struct IClassFactoryVtbl cf_vtbl =
cf_LockServer
};
static cf mime_body_cf = { &cf_vtbl, MimeBody_create };
static cf mime_allocator_cf = { &cf_vtbl, MimeAllocator_create };
static cf mime_message_cf = { &cf_vtbl, MimeMessage_create };
static cf mime_security_cf = { &cf_vtbl, MimeSecurity_create };
static cf virtual_stream_cf = { &cf_vtbl, VirtualStream_create };
static cf mime_body_cf = { { &cf_vtbl }, MimeBody_create };
static cf mime_allocator_cf = { { &cf_vtbl }, MimeAllocator_create };
static cf mime_message_cf = { { &cf_vtbl }, MimeMessage_create };
static cf mime_security_cf = { { &cf_vtbl }, MimeSecurity_create };
static cf virtual_stream_cf = { { &cf_vtbl }, VirtualStream_create };
/***********************************************************************
* DllGetClassObject (INETCOMM.@)
......@@ -170,23 +170,23 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
if ( IsEqualCLSID( rclsid, &CLSID_IMimeSecurity ))
{
cf = (IClassFactory*) &mime_security_cf.lpVtbl;
cf = &mime_security_cf.IClassFactory_iface;
}
else if( IsEqualCLSID( rclsid, &CLSID_IMimeMessage ))
{
cf = (IClassFactory*) &mime_message_cf.lpVtbl;
cf = &mime_message_cf.IClassFactory_iface;
}
else if( IsEqualCLSID( rclsid, &CLSID_IMimeBody ))
{
cf = (IClassFactory*) &mime_body_cf.lpVtbl;
cf = &mime_body_cf.IClassFactory_iface;
}
else if( IsEqualCLSID( rclsid, &CLSID_IMimeAllocator ))
{
cf = (IClassFactory*) &mime_allocator_cf.lpVtbl;
cf = &mime_allocator_cf.IClassFactory_iface;
}
else if( IsEqualCLSID( rclsid, &CLSID_IVirtualStream ))
{
cf = (IClassFactory*) &virtual_stream_cf.lpVtbl;
cf = &virtual_stream_cf.IClassFactory_iface;
}
if ( !cf )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment