Sebastian Lackner : schedsvc: Simplify and standardize the heap_xxx() declarations.

Alexandre Julliard julliard at winehq.org
Thu Mar 9 15:51:34 CST 2017


Module: wine
Branch: master
Commit: be0e05604a5560e26757d161708c2c3dae717834
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=be0e05604a5560e26757d161708c2c3dae717834

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Thu Mar  9 16:12:10 2017 +0100

schedsvc: Simplify and standardize the heap_xxx() declarations.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 3abce07..b426078 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 45496c9..bd8a29d 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);
 }




More information about the wine-cvs mailing list