Commit 505a9e02 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

regedit: Use the global HeapAlloc() wrappers.

parent 06a3a322
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#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);
......
...@@ -29,6 +29,7 @@ ...@@ -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"
......
...@@ -31,6 +31,7 @@ ...@@ -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);
......
...@@ -35,6 +35,7 @@ ...@@ -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"
......
...@@ -27,6 +27,7 @@ ...@@ -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;
......
...@@ -24,6 +24,7 @@ ...@@ -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);
......
...@@ -29,6 +29,7 @@ ...@@ -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[] = { ...@@ -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) ...@@ -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) ...@@ -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
......
...@@ -30,7 +30,6 @@ void WINAPIV error_exit(unsigned int id, ...); ...@@ -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);
...@@ -30,6 +30,7 @@ ...@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment