From d8d2805c9a4677704e245a398527822e646ef0b7 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Fri, 8 Nov 2002 18:54:44 +0000 Subject: [PATCH] Moved IMalloc definition from obj_base.h to obj_misc.h. --- include/wine/obj_base.h | 54 +------------------------------------------------ include/wine/obj_misc.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/include/wine/obj_base.h b/include/wine/obj_base.h index 18fa2313e44..aeda0958961 100644 --- a/include/wine/obj_base.h +++ b/include/wine/obj_base.h @@ -1,6 +1,6 @@ /* * This file defines the macros and types necessary to define COM interfaces, - * and the three most basic COM interfaces: IUnknown, IMalloc and IClassFactory. + * and the three most basic COM interfaces: IUnknown and IClassFactory. * * Copyright (C) 1999 Francois Gouget * @@ -644,9 +644,6 @@ INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax); DEFINE_OLEGUID(IID_IClassFactory, 0x00000001L, 0, 0); typedef struct IClassFactory IClassFactory, *LPCLASSFACTORY; -DEFINE_OLEGUID(IID_IMalloc, 0x00000002L, 0, 0); -typedef struct IMalloc IMalloc,*LPMALLOC; - DEFINE_OLEGUID(IID_IUnknown, 0x00000000L, 0, 0); typedef struct IUnknown IUnknown, *LPUNKNOWN; @@ -696,55 +693,6 @@ ICOM_DEFINE(IClassFactory,IUnknown) /***************************************************************************** - * IMalloc interface - */ -#define ICOM_INTERFACE IMalloc -#define IMalloc_METHODS \ - ICOM_METHOD1 (LPVOID,Alloc, DWORD,cb) \ - ICOM_METHOD2 (LPVOID,Realloc, LPVOID,pv, DWORD,cb) \ - ICOM_VMETHOD1( Free, LPVOID,pv) \ - ICOM_METHOD1(DWORD, GetSize, LPVOID,pv) \ - ICOM_METHOD1(INT, DidAlloc, LPVOID,pv) \ - ICOM_METHOD (VOID, HeapMinimize) -#define IMalloc_IMETHODS \ - IUnknown_IMETHODS \ - IMalloc_METHODS -ICOM_DEFINE(IMalloc,IUnknown) -#undef ICOM_INTERFACE - -/*** IUnknown methods ***/ -#define IMalloc_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) -#define IMalloc_AddRef(p) ICOM_CALL (AddRef,p) -#define IMalloc_Release(p) ICOM_CALL (Release,p) -/*** IMalloc methods ***/ -#define IMalloc_Alloc(p,a) ICOM_CALL1(Alloc,p,a) -#define IMalloc_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b) -#define IMalloc_Free(p,a) ICOM_CALL1(Free,p,a) -#define IMalloc_GetSize(p,a) ICOM_CALL1(GetSize,p,a) -#define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a) -#define IMalloc_HeapMinimize(p) ICOM_CALL (HeapMinimize,p) - -/* values passed to CoGetMalloc */ -#define MEMCTX_TASK 1 /* private task memory */ -#define MEMCTX_SHARED 2 /* shared memory */ -#ifdef _MAC -#define MEMCTX_MACSYSTEM 3 /* system heap on mac */ -#endif -/* mainly for internal use... */ -#define MEMCTX_UNKNOWN -1 -#define MEMCTX_SAME -2 - -HRESULT WINAPI CoGetMalloc(DWORD dwMemContext,LPMALLOC* lpMalloc); - -LPVOID WINAPI CoTaskMemAlloc(ULONG size); - -void WINAPI CoTaskMemFree(LPVOID ptr); - -/* FIXME: unimplemented */ -LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size); - - -/***************************************************************************** * Additional API */ diff --git a/include/wine/obj_misc.h b/include/wine/obj_misc.h index 13c8a97c015..baea60efac1 100644 --- a/include/wine/obj_misc.h +++ b/include/wine/obj_misc.h @@ -39,6 +39,9 @@ typedef struct IEnumString IEnumString,*LPENUMSTRING; DEFINE_OLEGUID(IID_IEnumUnknown, 0x00000100L, 0, 0); typedef struct IEnumUnknown IEnumUnknown,*LPENUMUNKNOWN; +DEFINE_OLEGUID(IID_IMalloc, 0x00000002L, 0, 0); +typedef struct IMalloc IMalloc,*LPMALLOC; + DEFINE_OLEGUID(IID_IMallocSpy, 0x0000001dL, 0, 0); typedef struct IMallocSpy IMallocSpy,*LPMALLOCSPY; @@ -100,6 +103,56 @@ ICOM_DEFINE(IEnumUnknown,IUnknown) /***************************************************************************** + * IMalloc interface + */ +#define ICOM_INTERFACE IMalloc +#define IMalloc_METHODS \ + ICOM_METHOD1 (LPVOID,Alloc, DWORD,cb) \ + ICOM_METHOD2 (LPVOID,Realloc, LPVOID,pv, DWORD,cb) \ + ICOM_VMETHOD1( Free, LPVOID,pv) \ + ICOM_METHOD1(DWORD, GetSize, LPVOID,pv) \ + ICOM_METHOD1(INT, DidAlloc, LPVOID,pv) \ + ICOM_METHOD (VOID, HeapMinimize) +#define IMalloc_IMETHODS \ + IUnknown_IMETHODS \ + IMalloc_METHODS +ICOM_DEFINE(IMalloc,IUnknown) +#undef ICOM_INTERFACE + +/*** IUnknown methods ***/ +#define IMalloc_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) +#define IMalloc_AddRef(p) ICOM_CALL (AddRef,p) +#define IMalloc_Release(p) ICOM_CALL (Release,p) +/*** IMalloc methods ***/ +#define IMalloc_Alloc(p,a) ICOM_CALL1(Alloc,p,a) +#define IMalloc_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b) +#define IMalloc_Free(p,a) ICOM_CALL1(Free,p,a) +#define IMalloc_GetSize(p,a) ICOM_CALL1(GetSize,p,a) +#define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a) +#define IMalloc_HeapMinimize(p) ICOM_CALL (HeapMinimize,p) + + +/* values passed to CoGetMalloc */ +#define MEMCTX_TASK 1 /* private task memory */ +#define MEMCTX_SHARED 2 /* shared memory */ +#ifdef _MAC +#define MEMCTX_MACSYSTEM 3 /* system heap on mac */ +#endif +/* mainly for internal use... */ +#define MEMCTX_UNKNOWN -1 +#define MEMCTX_SAME -2 + +HRESULT WINAPI CoGetMalloc(DWORD dwMemContext,LPMALLOC* lpMalloc); + +LPVOID WINAPI CoTaskMemAlloc(ULONG size); + +void WINAPI CoTaskMemFree(LPVOID ptr); + +/* FIXME: unimplemented */ +LPVOID WINAPI CoTaskMemRealloc(LPVOID ptr, ULONG size); + + +/***************************************************************************** * IMallocSpy interface */ #define ICOM_INTERFACE IMallocSpy -- 2.11.4.GIT