hnetcfg: Standardize the COM usage in service.c.

This commit is contained in:
Michael Stefaniuc 2010-12-20 11:34:38 +01:00 committed by Alexandre Julliard
parent a38022ac29
commit 329b311644
1 changed files with 8 additions and 8 deletions

View File

@ -36,13 +36,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(hnetcfg);
typedef struct fw_service typedef struct fw_service
{ {
const INetFwServiceVtbl *vtbl; INetFwService INetFwService_iface;
LONG refs; LONG refs;
} fw_service; } fw_service;
static inline fw_service *impl_from_INetFwService( INetFwService *iface ) static inline fw_service *impl_from_INetFwService( INetFwService *iface )
{ {
return (fw_service *)((char *)iface - FIELD_OFFSET( fw_service, vtbl )); return CONTAINING_RECORD(iface, fw_service, INetFwService_iface);
} }
static ULONG WINAPI fw_service_AddRef( static ULONG WINAPI fw_service_AddRef(
@ -295,10 +295,10 @@ static HRESULT NetFwService_create( IUnknown *pUnkOuter, LPVOID *ppObj )
fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY; if (!fp) return E_OUTOFMEMORY;
fp->vtbl = &fw_service_vtbl; fp->INetFwService_iface.lpVtbl = &fw_service_vtbl;
fp->refs = 1; fp->refs = 1;
*ppObj = &fp->vtbl; *ppObj = &fp->INetFwService_iface;
TRACE("returning iface %p\n", *ppObj); TRACE("returning iface %p\n", *ppObj);
return S_OK; return S_OK;
@ -306,13 +306,13 @@ static HRESULT NetFwService_create( IUnknown *pUnkOuter, LPVOID *ppObj )
typedef struct fw_services typedef struct fw_services
{ {
const INetFwServicesVtbl *vtbl; INetFwServices INetFwServices_iface;
LONG refs; LONG refs;
} fw_services; } fw_services;
static inline fw_services *impl_from_INetFwServices( INetFwServices *iface ) static inline fw_services *impl_from_INetFwServices( INetFwServices *iface )
{ {
return (fw_services *)((char *)iface - FIELD_OFFSET( fw_services, vtbl )); return CONTAINING_RECORD(iface, fw_services, INetFwServices_iface);
} }
static ULONG WINAPI fw_services_AddRef( static ULONG WINAPI fw_services_AddRef(
@ -469,10 +469,10 @@ HRESULT NetFwServices_create( IUnknown *pUnkOuter, LPVOID *ppObj )
fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) ); fp = HeapAlloc( GetProcessHeap(), 0, sizeof(*fp) );
if (!fp) return E_OUTOFMEMORY; if (!fp) return E_OUTOFMEMORY;
fp->vtbl = &fw_services_vtbl; fp->INetFwServices_iface.lpVtbl = &fw_services_vtbl;
fp->refs = 1; fp->refs = 1;
*ppObj = &fp->vtbl; *ppObj = &fp->INetFwServices_iface;
TRACE("returning iface %p\n", *ppObj); TRACE("returning iface %p\n", *ppObj);
return S_OK; return S_OK;