Implemented IMemAllocator.
[wine] / dlls / quartz / fmap.c
1 /*
2  * Implementation of CLSID_FilterMapper.
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 "fmap.h"
27
28 /* can I use offsetof safely? - FIXME? */
29 static QUARTZ_IFEntry IFEntries[] =
30 {
31   { &IID_IFilterMapper, offsetof(CFilterMapper,fmap)-offsetof(CFilterMapper,unk) },
32 };
33
34
35 static void QUARTZ_DestroyFilterMapper(IUnknown* punk)
36 {
37         CFilterMapper_THIS(punk,unk);
38
39         CFilterMapper_UninitIFilterMapper( This );
40 }
41
42 HRESULT QUARTZ_CreateFilterMapper(IUnknown* punkOuter,void** ppobj)
43 {
44         CFilterMapper*  pfm;
45         HRESULT hr;
46
47         TRACE("(%p,%p)\n",punkOuter,ppobj);
48
49         pfm = (CFilterMapper*)QUARTZ_AllocObj( sizeof(CFilterMapper) );
50         if ( pfm == NULL )
51                 return E_OUTOFMEMORY;
52
53         QUARTZ_IUnkInit( &pfm->unk, punkOuter );
54         hr = CFilterMapper_InitIFilterMapper( pfm );
55         if ( FAILED(hr) )
56         {
57                 QUARTZ_FreeObj( pfm );
58                 return hr;
59         }
60
61         pfm->unk.pEntries = IFEntries;
62         pfm->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
63         pfm->unk.pOnFinalRelease = QUARTZ_DestroyFilterMapper;
64
65         *ppobj = (void*)(&pfm->unk);
66
67         return S_OK;
68 }