Commit be0e0560 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

schedsvc: Simplify and standardize the heap_xxx() declarations.

parent 1c8cb597
......@@ -23,26 +23,24 @@
void schedsvc_auto_start(void) DECLSPEC_HIDDEN;
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(SIZE_T size)
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
{
return MIDL_user_allocate(size);
return HeapAlloc(GetProcessHeap(), 0, size);
}
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(SIZE_T size)
static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
{
void *ptr = MIDL_user_allocate(size);
if (ptr) memset(ptr, 0, size);
return ptr;
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}
static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *ptr, SIZE_T size)
static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size)
{
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
return HeapReAlloc(GetProcessHeap(), 0, mem, size);
}
static inline void heap_free(void *ptr)
static inline BOOL heap_free(void *mem)
{
MIDL_user_free(ptr);
return HeapFree(GetProcessHeap(), 0, mem);
}
static inline WCHAR *heap_strdupW(const WCHAR *src)
......
......@@ -27,6 +27,8 @@
#include "schrpc.h"
#include "wine/debug.h"
#include "schedsvc_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(schedsvc);
static const WCHAR scheduleW[] = {'S','c','h','e','d','u','l','e',0};
......@@ -200,10 +202,10 @@ void WINAPI ServiceMain(DWORD argc, LPWSTR *argv)
void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
return heap_alloc(len);
}
void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr)
{
HeapFree(GetProcessHeap(), 0, ptr);
heap_free(ptr);
}
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