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