Commit 6f323816 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/systemclock: Clean up the remaining IUnknown methods.

parent 1ecf2bf1
...@@ -108,29 +108,31 @@ static void notify_thread(SystemClockImpl *clock) ...@@ -108,29 +108,31 @@ static void notify_thread(SystemClockImpl *clock)
SetEvent(clock->notify_event); SetEvent(clock->notify_event);
} }
static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock* iface) { static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock *iface, REFIID iid, void **out)
SystemClockImpl *This = impl_from_IReferenceClock(iface); {
ULONG ref = InterlockedIncrement(&This->ref); SystemClockImpl *clock = impl_from_IReferenceClock(iface);
TRACE("clock %p, iid %s, out %p.\n", clock, debugstr_guid(iid), out);
TRACE("(%p): AddRef from %d\n", This, ref - 1); if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IReferenceClock))
{
IReferenceClock_AddRef(iface);
*out = iface;
return S_OK;
}
return ref; WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
*out = NULL;
return E_NOINTERFACE;
} }
static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REFIID riid, void** ppobj) { static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock *iface)
SystemClockImpl *This = impl_from_IReferenceClock(iface); {
TRACE("(%p, %s,%p)\n", This, debugstr_guid(riid), ppobj); SystemClockImpl *clock = impl_from_IReferenceClock(iface);
ULONG refcount = InterlockedIncrement(&clock->ref);
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IReferenceClock)) { TRACE("%p increasing refcount to %u.\n", clock, refcount);
SystemClockImpl_AddRef(iface);
*ppobj = &This->IReferenceClock_iface; return refcount;
return S_OK;
}
*ppobj = NULL;
WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
} }
static ULONG WINAPI SystemClockImpl_Release(IReferenceClock *iface) static ULONG WINAPI SystemClockImpl_Release(IReferenceClock *iface)
......
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