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

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

wine update

File size: 1.3 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
32static void QUARTZ_DestroyMemoryAllocator(IUnknown* punk)
33{
34 CMemoryAllocator_THIS(punk,unk);
35
36 CMemoryAllocator_UninitIMemAllocator( This );
37}
38
39HRESULT QUARTZ_CreateMemoryAllocator(IUnknown* punkOuter,void** ppobj)
40{
41 CMemoryAllocator* pma;
42 HRESULT hr;
43
44 TRACE("(%p,%p)\n",punkOuter,ppobj);
45
46 pma = (CMemoryAllocator*)QUARTZ_AllocObj( sizeof(CMemoryAllocator) );
47 if ( pma == NULL )
48 return E_OUTOFMEMORY;
49
50 QUARTZ_IUnkInit( &pma->unk, punkOuter );
51 hr = CMemoryAllocator_InitIMemAllocator( pma );
52 if ( FAILED(hr) )
53 {
54 QUARTZ_FreeObj( pma );
55 return hr;
56 }
57
58 pma->unk.pEntries = IFEntries;
59 pma->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
60 pma->unk.pOnFinalRelease = QUARTZ_DestroyMemoryAllocator;
61
62 *ppobj = (void*)(&pma->unk);
63
64 return S_OK;
65}
Note: See TracBrowser for help on using the repository browser.