Michael Stefaniuc : gameux: COM cleanup for the IClassFactory iface.

Alexandre Julliard julliard at winehq.org
Thu Jul 21 10:50:53 CDT 2011


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Thu Jul 21 13:30:27 2011 +0200

gameux: COM cleanup for the IClassFactory iface.

---

 dlls/gameux/factory.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/gameux/factory.c b/dlls/gameux/factory.c
index 38be7a5..5e8d1c6 100644
--- a/dlls/gameux/factory.c
+++ b/dlls/gameux/factory.c
@@ -41,13 +41,13 @@ typedef HRESULT (*fnCreateInstance)(IUnknown *pUnkOuter, IUnknown **ppObj);
  */
 typedef struct _gameuxcf
 {
-    const struct IClassFactoryVtbl *lpVtbl;
+    IClassFactory IClassFactory_iface;
     fnCreateInstance pfnCreateInstance;
 } gameuxcf;
 
 static inline gameuxcf *impl_from_IClassFactory(IClassFactory *iface)
 {
-    return (gameuxcf*)((char*)iface - FIELD_OFFSET(gameuxcf, lpVtbl));
+    return CONTAINING_RECORD(iface, gameuxcf, IClassFactory_iface);
 }
 
 static HRESULT WINAPI gameuxcf_QueryInterface(
@@ -130,8 +130,8 @@ static const struct IClassFactoryVtbl gameuxcf_vtbl =
     gameuxcf_LockServer
 };
 
-static gameuxcf gameexplorercf = { &gameuxcf_vtbl, GameExplorer_create };
-static gameuxcf gamestatisticscf  = { &gameuxcf_vtbl, GameStatistics_create };
+static gameuxcf gameexplorercf = { { &gameuxcf_vtbl }, GameExplorer_create };
+static gameuxcf gamestatisticscf  = { { &gameuxcf_vtbl }, GameStatistics_create };
 
 /***************************************************************
  * gameux ClassFactory
@@ -147,11 +147,11 @@ HRESULT WINAPI DllGetClassObject(
 
     if(IsEqualCLSID(rclsid, &CLSID_GameExplorer))
     {
-        cf = (IClassFactory*)&gameexplorercf.lpVtbl;
+        cf = &gameexplorercf.IClassFactory_iface;
     }
     else if( IsEqualCLSID( rclsid, &CLSID_GameStatistics ))
     {
-        cf = (IClassFactory*) &gamestatisticscf.lpVtbl;
+        cf = &gamestatisticscf.IClassFactory_iface;
     }
 
     if(!cf)




More information about the wine-cvs mailing list