schedsvc: Simplify and standardize the heap_xxx() declarations.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2017-03-09 16:12:10 +01:00 committed by Alexandre Julliard
parent 1c8cb59743
commit be0e05604a
2 changed files with 12 additions and 12 deletions

View file

@ -23,26 +23,24 @@
void schedsvc_auto_start(void) DECLSPEC_HIDDEN; 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); return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
if (ptr) memset(ptr, 0, size);
return ptr;
} }
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) static inline WCHAR *heap_strdupW(const WCHAR *src)

View file

@ -27,6 +27,8 @@
#include "schrpc.h" #include "schrpc.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "schedsvc_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(schedsvc); WINE_DEFAULT_DEBUG_CHANNEL(schedsvc);
static const WCHAR scheduleW[] = {'S','c','h','e','d','u','l','e',0}; 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) 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) void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr)
{ {
HeapFree(GetProcessHeap(), 0, ptr); heap_free(ptr);
} }