regedit: Use the global HeapAlloc() wrappers.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-02-07 00:20:07 +01:00 committed by Alexandre Julliard
parent 06a3a32294
commit 505a9e0283
9 changed files with 11 additions and 14 deletions

View File

@ -27,8 +27,9 @@
#include "regproc.h" #include "regproc.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h" #include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); WINE_DEFAULT_DEBUG_CHANNEL(regedit);
ChildWnd* g_pChildWnd; ChildWnd* g_pChildWnd;

View File

@ -29,6 +29,7 @@
#include <shellapi.h> #include <shellapi.h>
#include <shlwapi.h> #include <shlwapi.h>
#include "wine/heap.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "main.h" #include "main.h"
#include "regproc.h" #include "regproc.h"

View File

@ -31,6 +31,7 @@
#include "main.h" #include "main.h"
#include "regproc.h" #include "regproc.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "wine/unicode.h" #include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); WINE_DEFAULT_DEBUG_CHANNEL(regedit);

View File

@ -35,6 +35,7 @@
#include "winnls.h" #include "winnls.h"
#include "commctrl.h" #include "commctrl.h"
#include "wine/heap.h"
#include "main.h" #include "main.h"
#include "regproc.h" #include "regproc.h"

View File

@ -27,6 +27,7 @@
#include "main.h" #include "main.h"
#include "regproc.h" #include "regproc.h"
#include "wine/heap.h"
#include "wine/unicode.h" #include "wine/unicode.h"
static INT Image_String; static INT Image_String;

View File

@ -24,6 +24,7 @@
#include <shellapi.h> #include <shellapi.h>
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "regproc.h" #include "regproc.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); WINE_DEFAULT_DEBUG_CHANNEL(regedit);

View File

@ -29,6 +29,7 @@
#include <windows.h> #include <windows.h>
#include <wine/unicode.h> #include <wine/unicode.h>
#include <wine/debug.h> #include <wine/debug.h>
#include <wine/heap.h>
#include "regproc.h" #include "regproc.h"
WINE_DEFAULT_DEBUG_CHANNEL(regedit); WINE_DEFAULT_DEBUG_CHANNEL(regedit);
@ -46,7 +47,7 @@ static HKEY reg_class_keys[] = {
void *heap_xalloc(size_t size) void *heap_xalloc(size_t size)
{ {
void *buf = HeapAlloc(GetProcessHeap(), 0, size); void *buf = heap_alloc(size);
if (!buf) if (!buf)
{ {
ERR("Out of memory!\n"); ERR("Out of memory!\n");
@ -57,12 +58,7 @@ void *heap_xalloc(size_t size)
void *heap_xrealloc(void *buf, size_t size) void *heap_xrealloc(void *buf, size_t size)
{ {
void *new_buf; void *new_buf = heap_realloc(buf, size);
if (buf)
new_buf = HeapReAlloc(GetProcessHeap(), 0, buf, size);
else
new_buf = HeapAlloc(GetProcessHeap(), 0, size);
if (!new_buf) if (!new_buf)
{ {
@ -73,11 +69,6 @@ void *heap_xrealloc(void *buf, size_t size)
return new_buf; return new_buf;
} }
BOOL heap_free(void *buf)
{
return HeapFree(GetProcessHeap(), 0, buf);
}
/****************************************************************************** /******************************************************************************
* Allocates memory and converts input from multibyte to wide chars * Allocates memory and converts input from multibyte to wide chars
* Returned string must be freed by the caller * Returned string must be freed by the caller

View File

@ -30,7 +30,6 @@ void WINAPIV error_exit(unsigned int id, ...);
char *GetMultiByteString(const WCHAR *strW); char *GetMultiByteString(const WCHAR *strW);
void *heap_xalloc(size_t size); void *heap_xalloc(size_t size);
void *heap_xrealloc(void *buf, size_t size); void *heap_xrealloc(void *buf, size_t size);
BOOL heap_free(void *buf);
BOOL import_registry_file(FILE *reg_file); BOOL import_registry_file(FILE *reg_file);
void delete_registry_key(WCHAR *reg_key_name); void delete_registry_key(WCHAR *reg_key_name);
BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format); BOOL export_registry_key(WCHAR *file_name, WCHAR *path, DWORD format);

View File

@ -30,6 +30,7 @@
#include <wine/debug.h> #include <wine/debug.h>
#include <shlwapi.h> #include <shlwapi.h>
#include "wine/heap.h"
#include "main.h" #include "main.h"
#include "regproc.h" #include "regproc.h"