2 * Implementation of CLSID_FilterMapper2.
6 * hidenori@a2.ctktv.ne.jp
17 #include "wine/obj_base.h"
18 #include "wine/obj_oleaut.h"
23 #include "debugtools.h"
24 DEFAULT_DEBUG_CHANNEL(quartz
);
26 #include "quartz_private.h"
31 /***************************************************************************
33 * new/delete for CLSID_FilterMapper2
37 /* can I use offsetof safely? - FIXME? */
38 static QUARTZ_IFEntry IFEntries
[] =
40 { &IID_IFilterMapper2
, offsetof(CFilterMapper2
,fmap3
)-offsetof(CFilterMapper2
,unk
) },
41 { &IID_IFilterMapper3
, offsetof(CFilterMapper2
,fmap3
)-offsetof(CFilterMapper2
,unk
) },
45 static void QUARTZ_DestroyFilterMapper2(IUnknown
* punk
)
47 CFilterMapper2_THIS(punk
,unk
);
49 CFilterMapper2_UninitIFilterMapper3( This
);
52 HRESULT
QUARTZ_CreateFilterMapper2(IUnknown
* punkOuter
,void** ppobj
)
57 TRACE("(%p,%p)\n",punkOuter
,ppobj
);
59 pfm
= (CFilterMapper2
*)QUARTZ_AllocObj( sizeof(CFilterMapper2
) );
63 QUARTZ_IUnkInit( &pfm
->unk
, punkOuter
);
64 hr
= CFilterMapper2_InitIFilterMapper3( pfm
);
67 QUARTZ_FreeObj( pfm
);
71 pfm
->unk
.pEntries
= IFEntries
;
72 pfm
->unk
.dwEntries
= sizeof(IFEntries
)/sizeof(IFEntries
[0]);
73 pfm
->unk
.pOnFinalRelease
= QUARTZ_DestroyFilterMapper2
;
75 *ppobj
= (void*)(&pfm
->unk
);
80 /***************************************************************************
82 * CLSID_FilterMapper2::IFilterMapper3
88 IFilterMapper3_fnQueryInterface(IFilterMapper3
* iface
,REFIID riid
,void** ppobj
)
90 CFilterMapper2_THIS(iface
,fmap3
);
92 TRACE("(%p)->()\n",This
);
94 return IUnknown_QueryInterface(This
->unk
.punkControl
,riid
,ppobj
);
98 IFilterMapper3_fnAddRef(IFilterMapper3
* iface
)
100 CFilterMapper2_THIS(iface
,fmap3
);
102 TRACE("(%p)->()\n",This
);
104 return IUnknown_AddRef(This
->unk
.punkControl
);
108 IFilterMapper3_fnRelease(IFilterMapper3
* iface
)
110 CFilterMapper2_THIS(iface
,fmap3
);
112 TRACE("(%p)->()\n",This
);
114 return IUnknown_Release(This
->unk
.punkControl
);
117 static HRESULT WINAPI
118 IFilterMapper3_fnCreateCategory(IFilterMapper3
* iface
,REFCLSID rclsidCategory
,DWORD dwMerit
,LPCWSTR lpwszDesc
)
120 CFilterMapper2_THIS(iface
,fmap3
);
122 FIXME("(%p)->(%s,%lu,%s) stub!\n",This
,
123 debugstr_guid(rclsidCategory
),
124 (unsigned long)dwMerit
,debugstr_w(lpwszDesc
));
130 static HRESULT WINAPI
131 IFilterMapper3_fnUnregisterFilter(IFilterMapper3
* iface
,const CLSID
* pclsidCategory
,const OLECHAR
* lpwszInst
,REFCLSID rclsidFilter
)
133 CFilterMapper2_THIS(iface
,fmap3
);
135 FIXME("(%p)->(%s,%s,%s) stub!\n",This
,
136 debugstr_guid(pclsidCategory
),
137 debugstr_w(lpwszInst
),
138 debugstr_guid(rclsidFilter
));
140 if ( pclsidCategory
== NULL
)
141 pclsidCategory
= &CLSID_LegacyAmFilterCategory
;
144 return QUARTZ_RegisterAMovieFilter(
148 NULL
, lpwszInst
, FALSE
);
152 static HRESULT WINAPI
153 IFilterMapper3_fnRegisterFilter(IFilterMapper3
* iface
,REFCLSID rclsidFilter
,LPCWSTR lpName
,IMoniker
** ppMoniker
,const CLSID
* pclsidCategory
,const OLECHAR
* lpwszInst
,const REGFILTER2
* pRF2
)
155 CFilterMapper2_THIS(iface
,fmap3
);
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
);
162 if ( lpName
== NULL
|| pRF2
== NULL
)
165 if ( ppMoniker
!= NULL
)
167 FIXME( "ppMoniker != NULL - not implemented!\n" );
171 if ( pclsidCategory
== NULL
)
172 pclsidCategory
= &CLSID_LegacyAmFilterCategory
;
174 /* FIXME!! - all members in REGFILTER2 are ignored ! */
176 return QUARTZ_RegisterAMovieFilter(
180 lpName
, lpwszInst
, TRUE
);
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
)
187 CFilterMapper2_THIS(iface
,fmap3
);
189 FIXME("(%p)->() stub!\n",This
);
194 static HRESULT WINAPI
195 IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3
* iface
,ICreateDevEnum
** ppDevEnum
)
197 CFilterMapper2_THIS(iface
,fmap3
);
200 FIXME("(%p)->() stub!\n",This
);
208 static ICOM_VTABLE(IFilterMapper3
) ifmap3
=
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
,
225 HRESULT
CFilterMapper2_InitIFilterMapper3( CFilterMapper2
* pfm
)
228 ICOM_VTBL(&pfm
->fmap3
) = &ifmap3
;
233 void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2
* pfm
)