2 * Implementation of CLSID_SystemClock.
6 * hidenori@a2.ctktv.ne.jp
15 #include "wine/obj_base.h"
19 #include "debugtools.h"
20 DEFAULT_DEBUG_CHANNEL(quartz);
22 #include "quartz_private.h"
26 /* can I use offsetof safely? - FIXME? */
27 static QUARTZ_IFEntry IFEntries[] =
29 { &IID_IReferenceClock, offsetof(CSystemClock,refclk)-offsetof(CSystemClock,unk) },
33 static void QUARTZ_DestroySystemClock(IUnknown* punk)
35 CSystemClock_THIS(punk,unk);
37 CSystemClock_UninitIReferenceClock( This );
40 HRESULT QUARTZ_CreateSystemClock(IUnknown* punkOuter,void** ppobj)
45 TRACE("(%p,%p)\n",punkOuter,ppobj);
47 psc = (CSystemClock*)QUARTZ_AllocObj( sizeof(CSystemClock) );
51 QUARTZ_IUnkInit( &psc->unk, punkOuter );
52 hr = CSystemClock_InitIReferenceClock( psc );
55 QUARTZ_FreeObj( psc );
59 psc->unk.pEntries = IFEntries;
60 psc->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
61 psc->unk.pOnFinalRelease = QUARTZ_DestroySystemClock;
63 *ppobj = (void*)(&psc->unk);