Module: wine Branch: master Commit: 6542c3e8607fff57756ab16f2096601c3eaf01e0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=6542c3e8607fff57756ab16f2...
Author: Michael Stefaniuc mstefani@winehq.org Date: Wed Feb 7 23:48:40 2018 +0100
reg: Use the global HeapAlloc() wrappers.
Signed-off-by: Michael Stefaniuc mstefani@winehq.org Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/reg/export.c | 1 + programs/reg/import.c | 1 + programs/reg/reg.c | 15 +++------------ programs/reg/reg.h | 1 - 4 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/programs/reg/export.c b/programs/reg/export.c index 39001c8..622e7ca 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -20,6 +20,7 @@ #include <stdlib.h>
#include <wine/unicode.h> +#include <wine/heap.h>
#include "reg.h"
diff --git a/programs/reg/import.c b/programs/reg/import.c index 8350fa7..f2ce80e 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -23,6 +23,7 @@
#include <wine/unicode.h> #include <wine/debug.h> +#include <wine/heap.h>
#include "reg.h"
diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 8d510f7..455d3dd 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <wine/unicode.h> #include <wine/debug.h> +#include <wine/heap.h> #include "reg.h"
WINE_DEFAULT_DEBUG_CHANNEL(reg); @@ -81,7 +82,7 @@ static const WCHAR newlineW[] = {'\n',0};
void *heap_xalloc(size_t size) { - void *buf = HeapAlloc(GetProcessHeap(), 0, size); + void *buf = heap_alloc(size); if (!buf) { ERR("Out of memory!\n"); @@ -92,12 +93,7 @@ void *heap_xalloc(size_t size)
void *heap_xrealloc(void *buf, size_t size) { - void *new_buf; - - if (buf) - new_buf = HeapReAlloc(GetProcessHeap(), 0, buf, size); - else - new_buf = HeapAlloc(GetProcessHeap(), 0, size); + void *new_buf = heap_realloc(buf, size);
if (!new_buf) { @@ -108,11 +104,6 @@ void *heap_xrealloc(void *buf, size_t size) return new_buf; }
-BOOL heap_free(void *buf) -{ - return HeapFree(GetProcessHeap(), 0, buf); -} - void output_writeconsole(const WCHAR *str, DWORD wlen) { DWORD count, ret; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index eb792bb..dbce738 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -27,7 +27,6 @@ /* reg.c */ void *heap_xalloc(size_t size); void *heap_xrealloc(void *buf, size_t size); -BOOL heap_free(void *buf); void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...); BOOL ask_confirm(unsigned int msgid, WCHAR *reg_info);