Commit f27f7544 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ole32: Use an iface instead of a vtbl pointer in RemUnknown.

parent f4a0e349
......@@ -578,12 +578,17 @@ BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid)
typedef struct rem_unknown
{
const IRemUnknownVtbl *lpVtbl;
IRemUnknown IRemUnknown_iface;
LONG refs;
} RemUnknown;
static const IRemUnknownVtbl RemUnknown_Vtbl;
static inline RemUnknown *impl_from_IRemUnknown(IRemUnknown *iface)
{
return CONTAINING_RECORD(iface, RemUnknown, IRemUnknown_iface);
}
/* construct an IRemUnknown object with one outstanding reference */
static HRESULT RemUnknown_Construct(IRemUnknown **ppRemUnknown)
......@@ -592,10 +597,10 @@ static HRESULT RemUnknown_Construct(IRemUnknown **ppRemUnknown)
if (!This) return E_OUTOFMEMORY;
This->lpVtbl = &RemUnknown_Vtbl;
This->IRemUnknown_iface.lpVtbl = &RemUnknown_Vtbl;
This->refs = 1;
*ppRemUnknown = (IRemUnknown *)This;
*ppRemUnknown = &This->IRemUnknown_iface;
return S_OK;
}
......@@ -620,7 +625,7 @@ static HRESULT WINAPI RemUnknown_QueryInterface(IRemUnknown *iface, REFIID riid,
static ULONG WINAPI RemUnknown_AddRef(IRemUnknown *iface)
{
ULONG refs;
RemUnknown *This = (RemUnknown *)iface;
RemUnknown *This = impl_from_IRemUnknown(iface);
refs = InterlockedIncrement(&This->refs);
......@@ -631,7 +636,7 @@ static ULONG WINAPI RemUnknown_AddRef(IRemUnknown *iface)
static ULONG WINAPI RemUnknown_Release(IRemUnknown *iface)
{
ULONG refs;
RemUnknown *This = (RemUnknown *)iface;
RemUnknown *This = impl_from_IRemUnknown(iface);
refs = InterlockedDecrement(&This->refs);
if (!refs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment