wmiutils: Use an iface instead of an vtbl pointer in status_code.

This commit is contained in:
Michael Stefaniuc 2010-12-20 11:35:32 +01:00 committed by Alexandre Julliard
parent cdf56820a0
commit a1f5460488
1 changed files with 4 additions and 4 deletions

View File

@ -37,13 +37,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmiutils);
typedef struct status_code
{
const IWbemStatusCodeTextVtbl *vtbl;
IWbemStatusCodeText IWbemStatusCodeText_iface;
LONG refs;
} status_code;
static inline status_code *impl_from_IWbemStatusCodeText( IWbemStatusCodeText *iface )
{
return (status_code *)((char *)iface - FIELD_OFFSET( status_code, vtbl ));
return CONTAINING_RECORD(iface, status_code, IWbemStatusCodeText_iface);
}
static ULONG WINAPI status_code_AddRef(
@ -143,10 +143,10 @@ HRESULT WbemStatusCodeText_create( IUnknown *pUnkOuter, LPVOID *ppObj )
sc = HeapAlloc( GetProcessHeap(), 0, sizeof(*sc) );
if (!sc) return E_OUTOFMEMORY;
sc->vtbl = &status_code_vtbl;
sc->IWbemStatusCodeText_iface.lpVtbl = &status_code_vtbl;
sc->refs = 1;
*ppObj = &sc->vtbl;
*ppObj = &sc->IWbemStatusCodeText_iface;
TRACE("returning iface %p\n", *ppObj);
return S_OK;