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

Alexandre Julliard julliard at winehq.org
Sun Dec 5 12:10:10 CST 2010


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Sun Dec  5 15:15:04 2010 +0100

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

---

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

diff --git a/dlls/wbemprox/wbemlocator.c b/dlls/wbemprox/wbemlocator.c
index ad6a75d..a1dd5a1 100644
--- a/dlls/wbemprox/wbemlocator.c
+++ b/dlls/wbemprox/wbemlocator.c
@@ -35,13 +35,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
 
 typedef struct
 {
-    const IWbemLocatorVtbl *vtbl;
+    IWbemLocator IWbemLocator_iface;
     LONG refs;
 } wbem_locator;
 
 static inline wbem_locator *impl_from_IWbemLocator( IWbemLocator *iface )
 {
-    return (wbem_locator *)((char *)iface - FIELD_OFFSET( wbem_locator, vtbl ));
+    return CONTAINING_RECORD(iface, wbem_locator, IWbemLocator_iface);
 }
 
 static ULONG WINAPI wbem_locator_AddRef(
@@ -120,10 +120,10 @@ HRESULT WbemLocator_create( IUnknown *pUnkOuter, LPVOID *ppObj )
     wl = HeapAlloc( GetProcessHeap(), 0, sizeof(*wl) );
     if (!wl) return E_OUTOFMEMORY;
 
-    wl->vtbl = &wbem_locator_vtbl;
+    wl->IWbemLocator_iface.lpVtbl = &wbem_locator_vtbl;
     wl->refs = 1;
 
-    *ppObj = &wl->vtbl;
+    *ppObj = &wl->IWbemLocator_iface;
 
     TRACE("returning iface %p\n", *ppObj);
     return S_OK;




More information about the wine-cvs mailing list