Fixed some broken macros.
[wine/multimedia.git] / dlls / quartz / seekpass.c
blob0620f314a5148671826404956856ec4a2e64eac5
1 /*
2 * Implementation of CLSID_SeekingPassThru.
4 * hidenori@a2.ctktv.ne.jp
5 */
7 #include "config.h"
9 #include "windef.h"
10 #include "winbase.h"
11 #include "wingdi.h"
12 #include "winerror.h"
13 #include "wine/obj_base.h"
14 #include "strmif.h"
15 #include "uuids.h"
17 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(quartz);
20 #include "quartz_private.h"
21 #include "seekpass.h"
25 static HRESULT WINAPI
26 ISeekingPassThru_fnQueryInterface(ISeekingPassThru* iface,REFIID riid,void** ppobj)
28 CSeekingPassThru_THIS(iface,seekpass);
30 TRACE("(%p)->()\n",This);
32 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
35 static ULONG WINAPI
36 ISeekingPassThru_fnAddRef(ISeekingPassThru* iface)
38 CSeekingPassThru_THIS(iface,seekpass);
40 TRACE("(%p)->()\n",This);
42 return IUnknown_AddRef(This->unk.punkControl);
45 static ULONG WINAPI
46 ISeekingPassThru_fnRelease(ISeekingPassThru* iface)
48 CSeekingPassThru_THIS(iface,seekpass);
50 TRACE("(%p)->()\n",This);
52 return IUnknown_Release(This->unk.punkControl);
55 static HRESULT WINAPI
56 ISeekingPassThru_fnInit(ISeekingPassThru* iface,BOOL bRendering,IPin* pPin)
58 CSeekingPassThru_THIS(iface,seekpass);
60 FIXME("(%p)->(%d,%p) stub!\n",This,bRendering,pPin);
62 return E_NOTIMPL;
66 static ICOM_VTABLE(ISeekingPassThru) iseekingpassthru =
68 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
69 /* IUnknown fields */
70 ISeekingPassThru_fnQueryInterface,
71 ISeekingPassThru_fnAddRef,
72 ISeekingPassThru_fnRelease,
73 /* ISeekingPassThru fields */
74 ISeekingPassThru_fnInit,
77 static
78 HRESULT CSeekingPassThru_InitISeekingPassThru(CSeekingPassThru* This)
80 TRACE("(%p)\n",This);
81 ICOM_VTBL(&This->seekpass) = &iseekingpassthru;
83 return NOERROR;
86 static
87 void CSeekingPassThru_UninitISeekingPassThru(CSeekingPassThru* This)
89 TRACE("(%p)\n",This);
93 /* can I use offsetof safely? - FIXME? */
94 static QUARTZ_IFEntry IFEntries[] =
96 { &IID_ISeekingPassThru, offsetof(CSeekingPassThru,seekpass)-offsetof(CSeekingPassThru,unk) },
100 static void QUARTZ_DestroySeekingPassThru(IUnknown* punk)
102 CSeekingPassThru_THIS(punk,unk);
104 CSeekingPassThru_UninitISeekingPassThru(This);
107 HRESULT QUARTZ_CreateSeekingPassThru(IUnknown* punkOuter,void** ppobj)
109 CSeekingPassThru* This;
110 HRESULT hr;
112 TRACE("(%p,%p)\n",punkOuter,ppobj);
114 This = (CSeekingPassThru*)QUARTZ_AllocObj( sizeof(CSeekingPassThru) );
115 if ( This == NULL )
116 return E_OUTOFMEMORY;
118 QUARTZ_IUnkInit( &This->unk, punkOuter );
119 hr = CSeekingPassThru_InitISeekingPassThru(This);
120 if ( FAILED(hr) )
122 QUARTZ_FreeObj( This );
123 return hr;
126 This->unk.pEntries = IFEntries;
127 This->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
128 This->unk.pOnFinalRelease = QUARTZ_DestroySeekingPassThru;
130 *ppobj = (void*)(&This->unk);
132 return S_OK;