Module: wine Branch: master Commit: 751a4fe945843edd0e257a1181a4d2fa2ce45a52 URL: http://source.winehq.org/git/wine.git/?a=commit;h=751a4fe945843edd0e257a1181...
Author: Michael Stefaniuc mstefani@redhat.de Date: Sun Dec 5 15:16:17 2010 +0100
infosoft: Use an iface instead of a vtbl pointer in IClassFactoryImpl.
---
dlls/infosoft/infosoft_main.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/infosoft/infosoft_main.c b/dlls/infosoft/infosoft_main.c index 78c097e..a177dfd 100644 --- a/dlls/infosoft/infosoft_main.c +++ b/dlls/infosoft/infosoft_main.c @@ -60,14 +60,19 @@ typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown*, REFIID, LPVOID*);
typedef struct { - const IClassFactoryVtbl *lpVtbl; - LPFNCREATEINSTANCE lpfnCI; + IClassFactory IClassFactory_iface; + LPFNCREATEINSTANCE lpfnCI; } CFImpl;
+static inline CFImpl *impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, CFImpl, IClassFactory_iface); +} + static HRESULT WINAPI infosoftcf_fnQueryInterface ( LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj) { - CFImpl *This = (CFImpl *)iface; + CFImpl *This = impl_from_IClassFactory(iface);
TRACE("(%p)->(%s)\n",This,debugstr_guid(riid));
@@ -97,7 +102,7 @@ static ULONG WINAPI infosoftcf_fnRelease(LPCLASSFACTORY iface) static HRESULT WINAPI infosoftcf_fnCreateInstance( LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject) { - CFImpl *This = (CFImpl *)iface; + CFImpl *This = impl_from_IClassFactory(iface);
TRACE("%p->(%p,%s,%p)\n", This, pUnkOuter, debugstr_guid(riid), ppvObject);
@@ -121,7 +126,7 @@ static const IClassFactoryVtbl infosoft_cfvt = infosoftcf_fnLockServer };
-static CFImpl wb_cf = { &infosoft_cfvt, wb_Constructor }; +static CFImpl wb_cf = { { &infosoft_cfvt }, wb_Constructor };
/*********************************************************************** * DllGetClassObject (INFOSOFT.@) @@ -137,7 +142,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) *ppv = NULL;
if (IsEqualIID(rclsid, &CLSID_wb_Neutral)) - pcf = (IClassFactory*) &wb_cf; + pcf = &wb_cf.IClassFactory_iface; else return CLASS_E_CLASSNOTAVAILABLE;