1 | /*
|
---|
2 | * Implementation of CLSID_FilterMapper2.
|
---|
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 "winreg.h"
|
---|
16 | #include "winerror.h"
|
---|
17 | #include "wine/obj_base.h"
|
---|
18 | #include "wine/obj_oleaut.h"
|
---|
19 | #include "strmif.h"
|
---|
20 | #include "control.h"
|
---|
21 | #include "uuids.h"
|
---|
22 |
|
---|
23 | #include "debugtools.h"
|
---|
24 | DEFAULT_DEBUG_CHANNEL(quartz);
|
---|
25 |
|
---|
26 | #include "quartz_private.h"
|
---|
27 | #include "fmap2.h"
|
---|
28 | #include "regsvr.h"
|
---|
29 |
|
---|
30 |
|
---|
31 | /***************************************************************************
|
---|
32 | *
|
---|
33 | * new/delete for CLSID_FilterMapper2
|
---|
34 | *
|
---|
35 | */
|
---|
36 |
|
---|
37 | /* can I use offsetof safely? - FIXME? */
|
---|
38 | static QUARTZ_IFEntry IFEntries[] =
|
---|
39 | {
|
---|
40 | { &IID_IFilterMapper2, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
|
---|
41 | { &IID_IFilterMapper3, offsetof(CFilterMapper2,fmap3)-offsetof(CFilterMapper2,unk) },
|
---|
42 | };
|
---|
43 |
|
---|
44 |
|
---|
45 | static void QUARTZ_DestroyFilterMapper2(IUnknown* punk)
|
---|
46 | {
|
---|
47 | CFilterMapper2_THIS(punk,unk);
|
---|
48 |
|
---|
49 | CFilterMapper2_UninitIFilterMapper3( This );
|
---|
50 | }
|
---|
51 |
|
---|
52 | HRESULT QUARTZ_CreateFilterMapper2(IUnknown* punkOuter,void** ppobj)
|
---|
53 | {
|
---|
54 | CFilterMapper2* pfm;
|
---|
55 | HRESULT hr;
|
---|
56 |
|
---|
57 | TRACE("(%p,%p)\n",punkOuter,ppobj);
|
---|
58 |
|
---|
59 | pfm = (CFilterMapper2*)QUARTZ_AllocObj( sizeof(CFilterMapper2) );
|
---|
60 | if ( pfm == NULL )
|
---|
61 | return E_OUTOFMEMORY;
|
---|
62 |
|
---|
63 | QUARTZ_IUnkInit( &pfm->unk, punkOuter );
|
---|
64 | hr = CFilterMapper2_InitIFilterMapper3( pfm );
|
---|
65 | if ( FAILED(hr) )
|
---|
66 | {
|
---|
67 | QUARTZ_FreeObj( pfm );
|
---|
68 | return hr;
|
---|
69 | }
|
---|
70 |
|
---|
71 | pfm->unk.pEntries = IFEntries;
|
---|
72 | pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
|
---|
73 | pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper2;
|
---|
74 |
|
---|
75 | *ppobj = (void*)(&pfm->unk);
|
---|
76 |
|
---|
77 | return S_OK;
|
---|
78 | }
|
---|
79 |
|
---|
80 | /***************************************************************************
|
---|
81 | *
|
---|
82 | * CLSID_FilterMapper2::IFilterMapper3
|
---|
83 | *
|
---|
84 | */
|
---|
85 |
|
---|
86 |
|
---|
87 | static HRESULT WINAPI
|
---|
88 | IFilterMapper3_fnQueryInterface(IFilterMapper3* iface,REFIID riid,void** ppobj)
|
---|
89 | {
|
---|
90 | CFilterMapper2_THIS(iface,fmap3);
|
---|
91 |
|
---|
92 | TRACE("(%p)->()\n",This);
|
---|
93 |
|
---|
94 | return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
|
---|
95 | }
|
---|
96 |
|
---|
97 | static ULONG WINAPI
|
---|
98 | IFilterMapper3_fnAddRef(IFilterMapper3* iface)
|
---|
99 | {
|
---|
100 | CFilterMapper2_THIS(iface,fmap3);
|
---|
101 |
|
---|
102 | TRACE("(%p)->()\n",This);
|
---|
103 |
|
---|
104 | return IUnknown_AddRef(This->unk.punkControl);
|
---|
105 | }
|
---|
106 |
|
---|
107 | static ULONG WINAPI
|
---|
108 | IFilterMapper3_fnRelease(IFilterMapper3* iface)
|
---|
109 | {
|
---|
110 | CFilterMapper2_THIS(iface,fmap3);
|
---|
111 |
|
---|
112 | TRACE("(%p)->()\n",This);
|
---|
113 |
|
---|
114 | return IUnknown_Release(This->unk.punkControl);
|
---|
115 | }
|
---|
116 |
|
---|
117 | static HRESULT WINAPI
|
---|
118 | IFilterMapper3_fnCreateCategory(IFilterMapper3* iface,REFCLSID rclsidCategory,DWORD dwMerit,LPCWSTR lpwszDesc)
|
---|
119 | {
|
---|
120 | CFilterMapper2_THIS(iface,fmap3);
|
---|
121 |
|
---|
122 | FIXME("(%p)->(%s,%lu,%s) stub!\n",This,
|
---|
123 | debugstr_guid(rclsidCategory),
|
---|
124 | (unsigned long)dwMerit,debugstr_w(lpwszDesc));
|
---|
125 |
|
---|
126 | return E_NOTIMPL;
|
---|
127 | }
|
---|
128 |
|
---|
129 |
|
---|
130 | static HRESULT WINAPI
|
---|
131 | IFilterMapper3_fnUnregisterFilter(IFilterMapper3* iface,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,REFCLSID rclsidFilter)
|
---|
132 | {
|
---|
133 | CFilterMapper2_THIS(iface,fmap3);
|
---|
134 |
|
---|
135 | FIXME("(%p)->(%s,%s,%s) stub!\n",This,
|
---|
136 | debugstr_guid(pclsidCategory),
|
---|
137 | debugstr_w(lpwszInst),
|
---|
138 | debugstr_guid(rclsidFilter));
|
---|
139 |
|
---|
140 | if ( pclsidCategory == NULL )
|
---|
141 | pclsidCategory = &CLSID_LegacyAmFilterCategory;
|
---|
142 |
|
---|
143 | /* FIXME */
|
---|
144 | return QUARTZ_RegisterAMovieFilter(
|
---|
145 | pclsidCategory,
|
---|
146 | rclsidFilter,
|
---|
147 | NULL, 0,
|
---|
148 | NULL, lpwszInst, FALSE );
|
---|
149 | }
|
---|
150 |
|
---|
151 |
|
---|
152 | static HRESULT WINAPI
|
---|
153 | IFilterMapper3_fnRegisterFilter(IFilterMapper3* iface,REFCLSID rclsidFilter,LPCWSTR lpName,IMoniker** ppMoniker,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,const REGFILTER2* pRF2)
|
---|
154 | {
|
---|
155 | CFilterMapper2_THIS(iface,fmap3);
|
---|
156 |
|
---|
157 | FIXME( "(%p)->(%s,%s,%p,%s,%s,%p) stub!\n",This,
|
---|
158 | debugstr_guid(rclsidFilter),debugstr_w(lpName),
|
---|
159 | ppMoniker,debugstr_guid(pclsidCategory),
|
---|
160 | debugstr_w(lpwszInst),pRF2 );
|
---|
161 |
|
---|
162 | if ( lpName == NULL || pRF2 == NULL )
|
---|
163 | return E_POINTER;
|
---|
164 |
|
---|
165 | if ( ppMoniker != NULL )
|
---|
166 | {
|
---|
167 | FIXME( "ppMoniker != NULL - not implemented!\n" );
|
---|
168 | return E_NOTIMPL;
|
---|
169 | }
|
---|
170 |
|
---|
171 | if ( pclsidCategory == NULL )
|
---|
172 | pclsidCategory = &CLSID_LegacyAmFilterCategory;
|
---|
173 |
|
---|
174 | /* FIXME!! - all members in REGFILTER2 are ignored ! */
|
---|
175 |
|
---|
176 | return QUARTZ_RegisterAMovieFilter(
|
---|
177 | pclsidCategory,
|
---|
178 | rclsidFilter,
|
---|
179 | NULL, 0,
|
---|
180 | lpName, lpwszInst, TRUE );
|
---|
181 | }
|
---|
182 |
|
---|
183 |
|
---|
184 | static HRESULT WINAPI
|
---|
185 | IFilterMapper3_fnEnumMatchingFilters(IFilterMapper3* iface,IEnumMoniker** ppMoniker,DWORD dwFlags,BOOL bExactMatch,DWORD dwMerit,BOOL bInputNeeded,DWORD cInputTypes,const GUID* pguidInputTypes,const REGPINMEDIUM* pPinMediumIn,const CLSID* pPinCategoryIn,BOOL bRender,BOOL bOutputNeeded,DWORD cOutputTypes,const GUID* pguidOutputTypes,const REGPINMEDIUM* pPinMediumOut,const CLSID* pPinCategoryOut)
|
---|
186 | {
|
---|
187 | CFilterMapper2_THIS(iface,fmap3);
|
---|
188 |
|
---|
189 | FIXME("(%p)->() stub!\n",This);
|
---|
190 |
|
---|
191 | return E_NOTIMPL;
|
---|
192 | }
|
---|
193 |
|
---|
194 | static HRESULT WINAPI
|
---|
195 | IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3* iface,ICreateDevEnum** ppDevEnum)
|
---|
196 | {
|
---|
197 | CFilterMapper2_THIS(iface,fmap3);
|
---|
198 |
|
---|
199 | /* undocumented */
|
---|
200 | FIXME("(%p)->() stub!\n",This);
|
---|
201 |
|
---|
202 | return E_NOTIMPL;
|
---|
203 | }
|
---|
204 |
|
---|
205 |
|
---|
206 |
|
---|
207 |
|
---|
208 | static ICOM_VTABLE(IFilterMapper3) ifmap3 =
|
---|
209 | {
|
---|
210 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
---|
211 | /* IUnknown fields */
|
---|
212 | IFilterMapper3_fnQueryInterface,
|
---|
213 | IFilterMapper3_fnAddRef,
|
---|
214 | IFilterMapper3_fnRelease,
|
---|
215 | /* IFilterMapper2 fields */
|
---|
216 | IFilterMapper3_fnCreateCategory,
|
---|
217 | IFilterMapper3_fnUnregisterFilter,
|
---|
218 | IFilterMapper3_fnRegisterFilter,
|
---|
219 | IFilterMapper3_fnEnumMatchingFilters,
|
---|
220 | /* IFilterMapper3 fields */
|
---|
221 | IFilterMapper3_fnGetICreateDevEnum,
|
---|
222 | };
|
---|
223 |
|
---|
224 |
|
---|
225 | HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* pfm )
|
---|
226 | {
|
---|
227 | TRACE("(%p)\n",pfm);
|
---|
228 | ICOM_VTBL(&pfm->fmap3) = &ifmap3;
|
---|
229 |
|
---|
230 | return NOERROR;
|
---|
231 | }
|
---|
232 |
|
---|
233 | void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* pfm )
|
---|
234 | {
|
---|
235 | TRACE("(%p)\n",pfm);
|
---|
236 | }
|
---|
237 |
|
---|