Zebediah Figura : quartz/systemclock: Clean up the remaining IUnknown methods.
Alexandre Julliard
julliard at winehq.org
Mon Mar 18 16:20:13 CDT 2019
Module: wine
Branch: master
Commit: 6f3238168ebad9f9955462309b4363577f6d10c1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6f3238168ebad9f9955462309b4363577f6d10c1
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Sat Mar 16 09:11:49 2019 -0500
quartz/systemclock: Clean up the remaining IUnknown methods.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/systemclock.c | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
index f22c781..1a1361c 100644
--- a/dlls/quartz/systemclock.c
+++ b/dlls/quartz/systemclock.c
@@ -108,29 +108,31 @@ static void notify_thread(SystemClockImpl *clock)
SetEvent(clock->notify_event);
}
-static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock* iface) {
- SystemClockImpl *This = impl_from_IReferenceClock(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
+static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock *iface, REFIID iid, void **out)
+{
+ 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) {
- SystemClockImpl *This = impl_from_IReferenceClock(iface);
- TRACE("(%p, %s,%p)\n", This, debugstr_guid(riid), ppobj);
-
- if (IsEqualIID (riid, &IID_IUnknown) ||
- IsEqualIID (riid, &IID_IReferenceClock)) {
- SystemClockImpl_AddRef(iface);
- *ppobj = &This->IReferenceClock_iface;
- return S_OK;
- }
-
- *ppobj = NULL;
- WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppobj);
- return E_NOINTERFACE;
+static ULONG WINAPI SystemClockImpl_AddRef(IReferenceClock *iface)
+{
+ SystemClockImpl *clock = impl_from_IReferenceClock(iface);
+ ULONG refcount = InterlockedIncrement(&clock->ref);
+
+ TRACE("%p increasing refcount to %u.\n", clock, refcount);
+
+ return refcount;
}
static ULONG WINAPI SystemClockImpl_Release(IReferenceClock *iface)
More information about the wine-cvs
mailing list