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

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


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

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

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

---

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

diff --git a/dlls/wuapi/session.c b/dlls/wuapi/session.c
index 5f163c7..a6abbc6 100644
--- a/dlls/wuapi/session.c
+++ b/dlls/wuapi/session.c
@@ -36,13 +36,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wuapi);
 
 typedef struct _update_session
 {
-    const struct IUpdateSessionVtbl *vtbl;
+    IUpdateSession IUpdateSession_iface;
     LONG refs;
 } update_session;
 
 static inline update_session *impl_from_IUpdateSession( IUpdateSession *iface )
 {
-    return (update_session *)((char *)iface - FIELD_OFFSET( update_session, vtbl ));
+    return CONTAINING_RECORD(iface, update_session, IUpdateSession_iface);
 }
 
 static ULONG WINAPI update_session_AddRef(
@@ -226,10 +226,10 @@ HRESULT UpdateSession_create( IUnknown *pUnkOuter, LPVOID *ppObj )
     session = HeapAlloc( GetProcessHeap(), 0, sizeof(*session) );
     if (!session) return E_OUTOFMEMORY;
 
-    session->vtbl = &update_session_vtbl;
+    session->IUpdateSession_iface.lpVtbl = &update_session_vtbl;
     session->refs = 1;
 
-    *ppObj = &session->vtbl;
+    *ppObj = &session->IUpdateSession_iface;
 
     TRACE("returning iface %p\n", *ppObj);
     return S_OK;




More information about the wine-cvs mailing list