| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Implementation of CLSID_SystemClock.
|
|---|
| 3 | *
|
|---|
| 4 | * FIXME - stub.
|
|---|
| 5 | *
|
|---|
| 6 | * hidenori@a2.ctktv.ne.jp
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | #include "config.h"
|
|---|
| 10 |
|
|---|
| 11 | #include "windef.h"
|
|---|
| 12 | #include "winbase.h"
|
|---|
| 13 | #include "wingdi.h"
|
|---|
| 14 | #include "winerror.h"
|
|---|
| 15 | #include "wine/obj_base.h"
|
|---|
| 16 | #include "strmif.h"
|
|---|
| 17 | #include "uuids.h"
|
|---|
| 18 |
|
|---|
| 19 | #include "debugtools.h"
|
|---|
| 20 | DEFAULT_DEBUG_CHANNEL(quartz);
|
|---|
| 21 |
|
|---|
| 22 | #include "quartz_private.h"
|
|---|
| 23 | #include "sysclock.h"
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | /* can I use offsetof safely? - FIXME? */
|
|---|
| 27 | static QUARTZ_IFEntry IFEntries[] =
|
|---|
| 28 | {
|
|---|
| 29 | { &IID_IReferenceClock, offsetof(CSystemClock,refclk)-offsetof(CSystemClock,unk) },
|
|---|
| 30 | };
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | static void QUARTZ_DestroySystemClock(IUnknown* punk)
|
|---|
| 34 | {
|
|---|
| 35 | CSystemClock_THIS(punk,unk);
|
|---|
| 36 |
|
|---|
| 37 | CSystemClock_UninitIReferenceClock( This );
|
|---|
| 38 | }
|
|---|
| 39 |
|
|---|
| 40 | HRESULT QUARTZ_CreateSystemClock(IUnknown* punkOuter,void** ppobj)
|
|---|
| 41 | {
|
|---|
| 42 | CSystemClock* psc;
|
|---|
| 43 | HRESULT hr;
|
|---|
| 44 |
|
|---|
| 45 | TRACE("(%p,%p)\n",punkOuter,ppobj);
|
|---|
| 46 |
|
|---|
| 47 | psc = (CSystemClock*)QUARTZ_AllocObj( sizeof(CSystemClock) );
|
|---|
| 48 | if ( psc == NULL )
|
|---|
| 49 | return E_OUTOFMEMORY;
|
|---|
| 50 |
|
|---|
| 51 | QUARTZ_IUnkInit( &psc->unk, punkOuter );
|
|---|
| 52 | hr = CSystemClock_InitIReferenceClock( psc );
|
|---|
| 53 | if ( FAILED(hr) )
|
|---|
| 54 | {
|
|---|
| 55 | QUARTZ_FreeObj( psc );
|
|---|
| 56 | return hr;
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | psc->unk.pEntries = IFEntries;
|
|---|
| 60 | psc->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
|
|---|
| 61 | psc->unk.pOnFinalRelease = QUARTZ_DestroySystemClock;
|
|---|
| 62 |
|
|---|
| 63 | *ppobj = (void*)(&psc->unk);
|
|---|
| 64 |
|
|---|
| 65 | return S_OK;
|
|---|
| 66 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.