Alexandre Julliard : imagehlp: Get rid of the custom heap.

Alexandre Julliard julliard at winehq.org
Mon Mar 25 16:54:58 CDT 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar 25 22:09:07 2019 +0100

imagehlp: Get rid of the custom heap.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/imagehlp/access.c        |  7 +++----
 dlls/imagehlp/imagehlp_main.c | 21 ---------------------
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/dlls/imagehlp/access.c b/dlls/imagehlp/access.c
index 66c3036..29315f1 100644
--- a/dlls/imagehlp/access.c
+++ b/dlls/imagehlp/access.c
@@ -35,7 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(imagehlp);
  */
 static LIST_ENTRY image_list = { &image_list, &image_list };
 
-DECLSPEC_HIDDEN extern HANDLE IMAGEHLP_hHeap;
 
 /***********************************************************************
  *		GetImageConfigInformation (IMAGEHLP.@)
@@ -74,12 +73,12 @@ PLOADED_IMAGE WINAPI ImageLoad(PCSTR dll_name, PCSTR dll_path)
 
     TRACE("(%s, %s)\n", dll_name, dll_path);
 
-    image = HeapAlloc(IMAGEHLP_hHeap, 0, sizeof(*image));
+    image = HeapAlloc(GetProcessHeap(), 0, sizeof(*image));
     if (!image) return NULL;
 
     if (!MapAndLoad(dll_name, dll_path, image, TRUE, TRUE))
     {
-        HeapFree(IMAGEHLP_hHeap, 0, image);
+        HeapFree(GetProcessHeap(), 0, image);
         return NULL;
     }
 
@@ -121,7 +120,7 @@ BOOL WINAPI ImageUnload(PLOADED_IMAGE loaded_image)
     entry->Flink->Blink = entry->Blink;
 
     UnMapAndLoad(loaded_image);
-    HeapFree(IMAGEHLP_hHeap, 0, loaded_image);
+    HeapFree(GetProcessHeap(), 0, loaded_image);
 
     return TRUE;
 }
diff --git a/dlls/imagehlp/imagehlp_main.c b/dlls/imagehlp/imagehlp_main.c
index e505126..183b744 100644
--- a/dlls/imagehlp/imagehlp_main.c
+++ b/dlls/imagehlp/imagehlp_main.c
@@ -25,27 +25,6 @@
 #include "imagehlp.h"
 #include "wine/debug.h"
 
-/**********************************************************************/
-DECLSPEC_HIDDEN HANDLE IMAGEHLP_hHeap = NULL;
-
-/***********************************************************************
- *           DllMain (IMAGEHLP.init)
- */
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
-  switch(fdwReason)
-    {
-    case DLL_PROCESS_ATTACH:
-      DisableThreadLibraryCalls(hinstDLL);
-      IMAGEHLP_hHeap = HeapCreate(0, 0x10000, 0);
-      break;
-    case DLL_PROCESS_DETACH:
-      if (lpvReserved) break;
-      HeapDestroy(IMAGEHLP_hHeap);
-      break;
-    }
-  return TRUE;
-}
 
 /***********************************************************************
  *           MarkImageAsRunFromSwap (IMAGEHLP.@)




More information about the wine-cvs mailing list