Michael Stefaniuc : wuapi: Use an iface instead of a vtbl pointer in update_installer.

Alexandre Julliard julliard at winehq.org
Fri Dec 10 11:56:58 CST 2010


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Dec 10 09:32:04 2010 +0100

wuapi: Use an iface instead of a vtbl pointer in update_installer.

---

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

diff --git a/dlls/wuapi/installer.c b/dlls/wuapi/installer.c
index 1a2c553..efc6ea3 100644
--- a/dlls/wuapi/installer.c
+++ b/dlls/wuapi/installer.c
@@ -35,13 +35,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
 
 typedef struct _update_installer
 {
-    const struct IUpdateInstallerVtbl *vtbl;
+    IUpdateInstaller IUpdateInstaller_iface;
     LONG refs;
 } update_installer;
 
 static inline update_installer *impl_from_IUpdateInstaller( IUpdateInstaller *iface )
 {
-    return (update_installer *)((char *)iface - FIELD_OFFSET( update_installer, vtbl ));
+    return CONTAINING_RECORD(iface, update_installer, IUpdateInstaller_iface);
 }
 
 static ULONG WINAPI update_installer_AddRef(
@@ -243,10 +243,10 @@ HRESULT UpdateInstaller_create( IUnknown *pUnkOuter, LPVOID *ppObj )
     installer = HeapAlloc( GetProcessHeap(), 0, sizeof(*installer) );
     if (!installer) return E_OUTOFMEMORY;
 
-    installer->vtbl = &update_installer_vtbl;
+    installer->IUpdateInstaller_iface.lpVtbl = &update_installer_vtbl;
     installer->refs = 1;
 
-    *ppObj = &installer->vtbl;
+    *ppObj = &installer->IUpdateInstaller_iface;
 
     TRACE("returning iface %p\n", *ppObj);
     return S_OK;




More information about the wine-cvs mailing list