Michael Stefaniuc : hnetcfg: Use an iface instead of an vtbl pointer in fw_policy.

Alexandre Julliard julliard at winehq.org
Mon Dec 20 17:49:52 CST 2010


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Mon Dec 20 11:34:15 2010 +0100

hnetcfg: Use an iface instead of an vtbl pointer in fw_policy.

---

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

diff --git a/dlls/hnetcfg/policy.c b/dlls/hnetcfg/policy.c
index cff8973..dd5a1fe 100644
--- a/dlls/hnetcfg/policy.c
+++ b/dlls/hnetcfg/policy.c
@@ -36,13 +36,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
 
 typedef struct fw_policy
 {
-    const INetFwPolicyVtbl *vtbl;
+    INetFwPolicy INetFwPolicy_iface;
     LONG refs;
 } fw_policy;
 
 static inline fw_policy *impl_from_INetFwPolicy( INetFwPolicy *iface )
 {
-    return (fw_policy *)((char *)iface - FIELD_OFFSET( fw_policy, vtbl ));
+    return CONTAINING_RECORD(iface, fw_policy, INetFwPolicy_iface);
 }
 
 static ULONG WINAPI fw_policy_AddRef(
@@ -186,10 +186,10 @@ HRESULT NetFwPolicy_create( IUnknown *pUnkOuter, LPVOID *ppObj )
     fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
     if (!fp) return E_OUTOFMEMORY;
 
-    fp->vtbl = &fw_policy_vtbl;
+    fp->INetFwPolicy_iface.lpVtbl = &fw_policy_vtbl;
     fp->refs = 1;
 
-    *ppObj = &fp->vtbl;
+    *ppObj = &fp->INetFwPolicy_iface;
 
     TRACE("returning iface %p\n", *ppObj);
     return S_OK;




More information about the wine-cvs mailing list