| * Implementation of CLSID_MemoryAllocator. |
| * hidenori@a2.ctktv.ne.jp |
| #include "wine/obj_base.h" |
| DEFAULT_DEBUG_CHANNEL(quartz); |
| #include "quartz_private.h" |
| /* can I use offsetof safely? - FIXME? */ |
| static QUARTZ_IFEntry IFEntries[] = |
| { &IID_IMemAllocator, offsetof(CMemoryAllocator,memalloc)-offsetof(CMemoryAllocator,unk) }, |
| static void QUARTZ_DestroyMemoryAllocator(IUnknown* punk) |
| CMemoryAllocator_THIS(punk,unk); |
| CMemoryAllocator_UninitIMemAllocator( This ); |
| HRESULT QUARTZ_CreateMemoryAllocator(IUnknown* punkOuter,void** ppobj) |
| TRACE("(%p,%p)\n",punkOuter,ppobj); |
| pma = (CMemoryAllocator*)QUARTZ_AllocObj( sizeof(CMemoryAllocator) ); |
| QUARTZ_IUnkInit( &pma->unk, punkOuter ); |
| hr = CMemoryAllocator_InitIMemAllocator( pma ); |
| pma->unk.pEntries = IFEntries; |
| pma->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]); |
| pma->unk.pOnFinalRelease = QUARTZ_DestroyMemoryAllocator; |
| *ppobj = (void*)(&pma->unk); |