schedsvc: Simplify and standardize the heap_xxx() declarations.
Sebastian Lackner
sebastian at fds-team.de
Thu Mar 9 09:12:10 CST 2017
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
This implements MIDL_user_allocate on top of heap_alloc, instead of doing
it the other way round.
dlls/schedsvc/schedsvc_private.h | 18 ++++++++----------
dlls/schedsvc/svc_main.c | 6 ++++--
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/schedsvc/schedsvc_private.h b/dlls/schedsvc/schedsvc_private.h
index 3abce07dcd6..b426078f3c2 100644
--- a/dlls/schedsvc/schedsvc_private.h
+++ b/dlls/schedsvc/schedsvc_private.h
@@ -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)
diff --git a/dlls/schedsvc/svc_main.c b/dlls/schedsvc/svc_main.c
index 45496c93e12..bd8a29dcd95 100644
--- a/dlls/schedsvc/svc_main.c
+++ b/dlls/schedsvc/svc_main.c
@@ -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);
}
--
2.11.0
More information about the wine-patches
mailing list