source: trunk/src/quartz/memalloc.c@ 6578

Last change on this file since 6578 was 6578, checked in by sandervl, 24 years ago

wine updates

File size: 1.0 KB
Line 
1/*
2 * Implementation of CLSID_MemoryAllocator.
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 "winerror.h"
15#include "wine/obj_base.h"
16#include "strmif.h"
17#include "uuids.h"
18
19#include "debugtools.h"
20DEFAULT_DEBUG_CHANNEL(quartz);
21
22#include "quartz_private.h"
23#include "memalloc.h"
24
25
26/* can I use offsetof safely? - FIXME? */
27static QUARTZ_IFEntry IFEntries[] =
28{
29 { &IID_IMemAllocator, offsetof(CMemoryAllocator,memalloc)-offsetof(CMemoryAllocator,unk) },
30};
31
32HRESULT QUARTZ_CreateMemoryAllocator(IUnknown* punkOuter,void** ppobj)
33{
34 CMemoryAllocator* pma;
35
36 TRACE("(%p,%p)\n",punkOuter,ppobj);
37
38 pma = (CMemoryAllocator*)QUARTZ_AllocObj( sizeof(CMemoryAllocator) );
39 if ( pma == NULL )
40 return E_OUTOFMEMORY;
41
42 QUARTZ_IUnkInit( &pma->unk, punkOuter );
43 CMemoryAllocator_InitIMemAllocator( pma );
44
45 pma->unk.pEntries = IFEntries;
46 pma->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
47
48 *ppobj = (void*)(&pma->unk);
49
50 return S_OK;
51}
Note: See TracBrowser for help on using the repository browser.