Commit b48f7bec authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

gameux: COM cleanup for the IClassFactory iface.

parent 4ecb339f
...@@ -41,13 +41,13 @@ typedef HRESULT (*fnCreateInstance)(IUnknown *pUnkOuter, IUnknown **ppObj); ...@@ -41,13 +41,13 @@ typedef HRESULT (*fnCreateInstance)(IUnknown *pUnkOuter, IUnknown **ppObj);
*/ */
typedef struct _gameuxcf typedef struct _gameuxcf
{ {
const struct IClassFactoryVtbl *lpVtbl; IClassFactory IClassFactory_iface;
fnCreateInstance pfnCreateInstance; fnCreateInstance pfnCreateInstance;
} gameuxcf; } gameuxcf;
static inline gameuxcf *impl_from_IClassFactory(IClassFactory *iface) 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( static HRESULT WINAPI gameuxcf_QueryInterface(
...@@ -130,8 +130,8 @@ static const struct IClassFactoryVtbl gameuxcf_vtbl = ...@@ -130,8 +130,8 @@ static const struct IClassFactoryVtbl gameuxcf_vtbl =
gameuxcf_LockServer gameuxcf_LockServer
}; };
static gameuxcf gameexplorercf = { &gameuxcf_vtbl, GameExplorer_create }; static gameuxcf gameexplorercf = { { &gameuxcf_vtbl }, GameExplorer_create };
static gameuxcf gamestatisticscf = { &gameuxcf_vtbl, GameStatistics_create }; static gameuxcf gamestatisticscf = { { &gameuxcf_vtbl }, GameStatistics_create };
/*************************************************************** /***************************************************************
* gameux ClassFactory * gameux ClassFactory
...@@ -147,11 +147,11 @@ HRESULT WINAPI DllGetClassObject( ...@@ -147,11 +147,11 @@ HRESULT WINAPI DllGetClassObject(
if(IsEqualCLSID(rclsid, &CLSID_GameExplorer)) if(IsEqualCLSID(rclsid, &CLSID_GameExplorer))
{ {
cf = (IClassFactory*)&gameexplorercf.lpVtbl; cf = &gameexplorercf.IClassFactory_iface;
} }
else if( IsEqualCLSID( rclsid, &CLSID_GameStatistics )) else if( IsEqualCLSID( rclsid, &CLSID_GameStatistics ))
{ {
cf = (IClassFactory*) &gamestatisticscf.lpVtbl; cf = &gamestatisticscf.IClassFactory_iface;
} }
if(!cf) 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