Commit 2e25e5e2 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

oleaut32: Use alloc/free helpers for typelib creation part too.

parent ed749f51
...@@ -1466,21 +1466,26 @@ static void TLB_abort(void) ...@@ -1466,21 +1466,26 @@ static void TLB_abort(void)
DebugBreak(); DebugBreak();
} }
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(unsigned size) void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(unsigned size)
{ {
void *ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); void *ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if (!ret) ERR("cannot allocate memory\n"); if (!ret) ERR("cannot allocate memory\n");
return ret; return ret;
} }
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(unsigned size) void* __WINE_ALLOC_SIZE(1) heap_alloc(unsigned size)
{ {
void *ret = HeapAlloc(GetProcessHeap(), 0, size); void *ret = HeapAlloc(GetProcessHeap(), 0, size);
if (!ret) ERR("cannot allocate memory\n"); if (!ret) ERR("cannot allocate memory\n");
return ret; return ret;
} }
static inline void heap_free(void *ptr) void* __WINE_ALLOC_SIZE(2) heap_realloc(void *ptr, unsigned size)
{
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
}
void heap_free(void *ptr)
{ {
HeapFree(GetProcessHeap(), 0, ptr); HeapFree(GetProcessHeap(), 0, ptr);
} }
......
...@@ -596,6 +596,12 @@ WORD typeofarray ...@@ -596,6 +596,12 @@ WORD typeofarray
#include "poppack.h" #include "poppack.h"
/* heap allocation helpers */
extern void* heap_alloc_zero(unsigned size);
extern void* heap_alloc(unsigned size);
extern void* heap_realloc(void *ptr, unsigned size);
extern void heap_free(void *ptr);
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc ); HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc );
extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args); extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment