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

Last change on this file since 6649 was 6649, checked in by bird, 24 years ago

Added $Id:$ keyword.

File size: 1.1 KB
Line 
1/* $Id: memalloc.c,v 1.3 2001-09-05 13:36:37 bird Exp $ */
2/*
3 * Implementation of CLSID_MemoryAllocator.
4 *
5 * FIXME - stub.
6 *
7 * hidenori@a2.ctktv.ne.jp
8 */
9
10#include "config.h"
11
12#include "windef.h"
13#include "winbase.h"
14#include "wingdi.h"
15#include "winerror.h"
16#include "wine/obj_base.h"
17#include "strmif.h"
18#include "uuids.h"
19
20#include "debugtools.h"
21DEFAULT_DEBUG_CHANNEL(quartz);
22
23#include "quartz_private.h"
24#include "memalloc.h"
25
26
27/* can I use offsetof safely? - FIXME? */
28static QUARTZ_IFEntry IFEntries[] =
29{
30 { &IID_IMemAllocator, offsetof(CMemoryAllocator,memalloc)-offsetof(CMemoryAllocator,unk) },
31};
32
33HRESULT QUARTZ_CreateMemoryAllocator(IUnknown* punkOuter,void** ppobj)
34{
35 CMemoryAllocator* pma;
36
37 TRACE("(%p,%p)\n",punkOuter,ppobj);
38
39 pma = (CMemoryAllocator*)QUARTZ_AllocObj( sizeof(CMemoryAllocator) );
40 if ( pma == NULL )
41 return E_OUTOFMEMORY;
42
43 QUARTZ_IUnkInit( &pma->unk, punkOuter );
44 CMemoryAllocator_InitIMemAllocator( pma );
45
46 pma->unk.pEntries = IFEntries;
47 pma->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
48
49 *ppobj = (void*)(&pma->unk);
50
51 return S_OK;
52}
Note: See TracBrowser for help on using the repository browser.