Michael Stefaniuc : wbemprox: Use an iface instead of a vtbl pointer in wbemprox_cf.

Alexandre Julliard julliard at winehq.org
Wed Dec 29 11:14:51 CST 2010


Module: wine
Branch: master
Commit: 17b4de2bba7ed2cb2ffa9ea6a3da9b1b2d696c27
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=17b4de2bba7ed2cb2ffa9ea6a3da9b1b2d696c27

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Dec 29 02:53:40 2010 +0100

wbemprox: Use an iface instead of a vtbl pointer in wbemprox_cf.

---

 dlls/wbemprox/main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wbemprox/main.c b/dlls/wbemprox/main.c
index 5f32bd2..c6bb240 100644
--- a/dlls/wbemprox/main.c
+++ b/dlls/wbemprox/main.c
@@ -40,13 +40,13 @@ typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj );
 
 typedef struct
 {
-    const struct IClassFactoryVtbl *vtbl;
+    IClassFactory IClassFactory_iface;
     fnCreateInstance pfnCreateInstance;
 } wbemprox_cf;
 
 static inline wbemprox_cf *impl_from_IClassFactory( IClassFactory *iface )
 {
-    return (wbemprox_cf *)((char *)iface - FIELD_OFFSET( wbemprox_cf, vtbl ));
+    return CONTAINING_RECORD(iface, wbemprox_cf, IClassFactory_iface);
 }
 
 static HRESULT WINAPI wbemprox_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
@@ -113,7 +113,7 @@ static const struct IClassFactoryVtbl wbemprox_cf_vtbl =
     wbemprox_cf_LockServer
 };
 
-static wbemprox_cf wbem_locator_cf = { &wbemprox_cf_vtbl, WbemLocator_create };
+static wbemprox_cf wbem_locator_cf = { { &wbemprox_cf_vtbl }, WbemLocator_create };
 
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
@@ -141,7 +141,7 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
 
     if (IsEqualGUID( rclsid, &CLSID_WbemLocator ))
     {
-       cf = (IClassFactory *)&wbem_locator_cf.vtbl;
+       cf = &wbem_locator_cf.IClassFactory_iface;
     }
     if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
     return IClassFactory_QueryInterface( cf, iid, ppv );




More information about the wine-cvs mailing list