| 1 | /*
|
|---|
| 2 | * Implementation of IGraphVersion for FilterGraph.
|
|---|
| 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 "wine/obj_oleaut.h"
|
|---|
| 17 | #include "strmif.h"
|
|---|
| 18 | #include "control.h"
|
|---|
| 19 | #include "uuids.h"
|
|---|
| 20 |
|
|---|
| 21 | #include "debugtools.h"
|
|---|
| 22 | DEFAULT_DEBUG_CHANNEL(quartz);
|
|---|
| 23 |
|
|---|
| 24 | #include "quartz_private.h"
|
|---|
| 25 | #include "fgraph.h"
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | static HRESULT WINAPI
|
|---|
| 30 | IGraphVersion_fnQueryInterface(IGraphVersion* iface,REFIID riid,void** ppobj)
|
|---|
| 31 | {
|
|---|
| 32 | CFilterGraph_THIS(iface,graphversion);
|
|---|
| 33 |
|
|---|
| 34 | TRACE("(%p)->()\n",This);
|
|---|
| 35 |
|
|---|
| 36 | return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | static ULONG WINAPI
|
|---|
| 40 | IGraphVersion_fnAddRef(IGraphVersion* iface)
|
|---|
| 41 | {
|
|---|
| 42 | CFilterGraph_THIS(iface,graphversion);
|
|---|
| 43 |
|
|---|
| 44 | TRACE("(%p)->()\n",This);
|
|---|
| 45 |
|
|---|
| 46 | return IUnknown_AddRef(This->unk.punkControl);
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | static ULONG WINAPI
|
|---|
| 50 | IGraphVersion_fnRelease(IGraphVersion* iface)
|
|---|
| 51 | {
|
|---|
| 52 | CFilterGraph_THIS(iface,graphversion);
|
|---|
| 53 |
|
|---|
| 54 | TRACE("(%p)->()\n",This);
|
|---|
| 55 |
|
|---|
| 56 | return IUnknown_Release(This->unk.punkControl);
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 | static HRESULT WINAPI
|
|---|
| 61 | IGraphVersion_fnQueryVersion(IGraphVersion* iface,LONG* plVersion)
|
|---|
| 62 | {
|
|---|
| 63 | CFilterGraph_THIS(iface,graphversion);
|
|---|
| 64 |
|
|---|
| 65 | TRACE("(%p)->(%p)\n",This,plVersion);
|
|---|
| 66 |
|
|---|
| 67 | if ( plVersion == NULL )
|
|---|
| 68 | return E_POINTER;
|
|---|
| 69 |
|
|---|
| 70 | EnterCriticalSection( &This->m_csGraphVersion );
|
|---|
| 71 | *plVersion = This->m_lGraphVersion;
|
|---|
| 72 | LeaveCriticalSection( &This->m_csGraphVersion );
|
|---|
| 73 |
|
|---|
| 74 | return NOERROR;
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | static ICOM_VTABLE(IGraphVersion) igraphversion =
|
|---|
| 79 | {
|
|---|
| 80 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|---|
| 81 | /* IUnknown fields */
|
|---|
| 82 | IGraphVersion_fnQueryInterface,
|
|---|
| 83 | IGraphVersion_fnAddRef,
|
|---|
| 84 | IGraphVersion_fnRelease,
|
|---|
| 85 | /* IGraphVersion fields */
|
|---|
| 86 | IGraphVersion_fnQueryVersion,
|
|---|
| 87 | };
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg )
|
|---|
| 92 | {
|
|---|
| 93 | TRACE("(%p)\n",pfg);
|
|---|
| 94 | ICOM_VTBL(&pfg->graphversion) = &igraphversion;
|
|---|
| 95 |
|
|---|
| 96 | InitializeCriticalSection( &pfg->m_csGraphVersion );
|
|---|
| 97 | pfg->m_lGraphVersion = 1;
|
|---|
| 98 |
|
|---|
| 99 | return NOERROR;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 | void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg )
|
|---|
| 103 | {
|
|---|
| 104 | TRACE("(%p)\n",pfg);
|
|---|
| 105 |
|
|---|
| 106 | DeleteCriticalSection( &pfg->m_csGraphVersion );
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|