Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- Though this sounds like a perfect opportunity for the infallible alloc / realloc versions. Maybe paired with an exception handler for STATUS_NO_MEMORY.
programs/regedit/childwnd.c | 3 ++- programs/regedit/edit.c | 1 + programs/regedit/framewnd.c | 1 + programs/regedit/hexedit.c | 1 + programs/regedit/listview.c | 1 + programs/regedit/regedit.c | 1 + programs/regedit/regproc.c | 15 +++------------ programs/regedit/regproc.h | 1 - programs/regedit/treeview.c | 1 + 9 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index 7a5633fb0d..0c6d895193 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -27,8 +27,9 @@ #include "regproc.h"
#include "wine/debug.h" +#include "wine/heap.h" #include "wine/unicode.h" - + WINE_DEFAULT_DEBUG_CHANNEL(regedit);
ChildWnd* g_pChildWnd; diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c index 6ccce00ce5..c8b77bd755 100644 --- a/programs/regedit/edit.c +++ b/programs/regedit/edit.c @@ -29,6 +29,7 @@ #include <shellapi.h> #include <shlwapi.h>
+#include "wine/heap.h" #include "wine/unicode.h" #include "main.h" #include "regproc.h" diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index c6fcee466d..94da217045 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -31,6 +31,7 @@ #include "main.h" #include "regproc.h" #include "wine/debug.h" +#include "wine/heap.h" #include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); diff --git a/programs/regedit/hexedit.c b/programs/regedit/hexedit.c index 3f05aa6d65..fc6c3a3b08 100644 --- a/programs/regedit/hexedit.c +++ b/programs/regedit/hexedit.c @@ -35,6 +35,7 @@ #include "winnls.h" #include "commctrl.h"
+#include "wine/heap.h" #include "main.h" #include "regproc.h"
diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c index 4c2ec36bb0..0934e03a39 100644 --- a/programs/regedit/listview.c +++ b/programs/regedit/listview.c @@ -27,6 +27,7 @@
#include "main.h" #include "regproc.h" +#include "wine/heap.h" #include "wine/unicode.h"
static INT Image_String; diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c index fe0163c56e..a69e929e48 100644 --- a/programs/regedit/regedit.c +++ b/programs/regedit/regedit.c @@ -24,6 +24,7 @@ #include <shellapi.h> #include "wine/unicode.h" #include "wine/debug.h" +#include "wine/heap.h" #include "regproc.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 0911b50110..35b03228c4 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -29,6 +29,7 @@ #include <windows.h> #include <wine/unicode.h> #include <wine/debug.h> +#include <wine/heap.h> #include "regproc.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); @@ -46,7 +47,7 @@ static HKEY reg_class_keys[] = {
void *heap_xalloc(size_t size) { - void *buf = HeapAlloc(GetProcessHeap(), 0, size); + void *buf = heap_alloc(size); if (!buf) { ERR("Out of memory!\n"); @@ -57,12 +58,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) { @@ -73,11 +69,6 @@ void *heap_xrealloc(void *buf, size_t size) return new_buf; }
-BOOL heap_free(void *buf) -{ - return HeapFree(GetProcessHeap(), 0, buf); -} - /****************************************************************************** * Allocates memory and converts input from multibyte to wide chars * Returned string must be freed by the caller diff --git a/programs/regedit/regproc.h b/programs/regedit/regproc.h index 9364fde7ec..bfb0cba04b 100644 --- a/programs/regedit/regproc.h +++ b/programs/regedit/regproc.h @@ -30,7 +30,6 @@ void WINAPIV error_exit(unsigned int id, ...); char *GetMultiByteString(const WCHAR *strW); void *heap_xalloc(size_t size); void *heap_xrealloc(void *buf, size_t size); -BOOL heap_free(void *buf); BOOL import_registry_file(FILE *reg_file); void delete_registry_key(WCHAR *reg_key_name); BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format); diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c index 77befb5280..4bbec40df8 100644 --- a/programs/regedit/treeview.c +++ b/programs/regedit/treeview.c @@ -30,6 +30,7 @@ #include <wine/debug.h> #include <shlwapi.h>
+#include "wine/heap.h" #include "main.h" #include "regproc.h"