Commit 1c0982e8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

oledb32: Use an iface instead of a vtbl pointer in IClassFactoryImpl.

parent ed5260ba
...@@ -59,13 +59,18 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID lpv) ...@@ -59,13 +59,18 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID lpv)
*/ */
typedef struct typedef struct
{ {
const IClassFactoryVtbl *lpVtbl; IClassFactory IClassFactory_iface;
HRESULT (*create_object)( IUnknown*, LPVOID* ); HRESULT (*create_object)( IUnknown*, LPVOID* );
} cf; } cf;
static inline cf *impl_from_IClassFactory(IClassFactory *iface)
{
return CONTAINING_RECORD(iface, cf, IClassFactory_iface);
}
static HRESULT WINAPI CF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj) static HRESULT WINAPI CF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
{ {
cf *This = (cf *)iface; cf *This = impl_from_IClassFactory(iface);
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj); TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj);
...@@ -91,7 +96,7 @@ static ULONG WINAPI CF_Release(IClassFactory *iface) ...@@ -91,7 +96,7 @@ static ULONG WINAPI CF_Release(IClassFactory *iface)
static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **obj) static HRESULT WINAPI CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **obj)
{ {
cf *This = (cf *)iface; cf *This = impl_from_IClassFactory(iface);
IUnknown *unk = NULL; IUnknown *unk = NULL;
HRESULT r; HRESULT r;
...@@ -121,7 +126,7 @@ static const IClassFactoryVtbl CF_Vtbl = ...@@ -121,7 +126,7 @@ static const IClassFactoryVtbl CF_Vtbl =
CF_LockServer CF_LockServer
}; };
static cf oledb_convert_cf = { &CF_Vtbl, create_oledb_convert }; static cf oledb_convert_cf = { { &CF_Vtbl }, create_oledb_convert };
/****************************************************************** /******************************************************************
* DllGetClassObject * DllGetClassObject
......
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