Jacek Caban : dbghelp: Use search_dll_path to load seach macho files.

Alexandre Julliard julliard at winehq.org
Mon Mar 23 15:47:11 CDT 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Mar 23 16:16:57 2020 +0100

dbghelp: Use search_dll_path to load seach macho files.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dbghelp/macho_module.c | 41 +----------------------------------------
 1 file changed, 1 insertion(+), 40 deletions(-)

diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 038319ce35..193c97b001 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -48,7 +48,6 @@
 #define WIN32_NO_STATUS
 #include "dbghelp_private.h"
 #include "winternl.h"
-#include "wine/library.h"
 #include "wine/debug.h"
 #include "wine/heap.h"
 #include "image_private.h"
@@ -1536,44 +1535,6 @@ static BOOL macho_load_file_cb(void *param, HANDLE handle, const WCHAR *filename
     return macho_load_file(macho_load->process, filename, macho_load->load_addr, macho_load->macho_info);
 }
 
-/******************************************************************
- *              macho_load_file_from_dll_path
- *
- * Tries to load a Mach-O file from the dll path
- */
-static BOOL macho_load_file_from_dll_path(struct process* pcs,
-                                          const WCHAR* filename,
-                                          unsigned long load_addr,
-                                          struct macho_info* macho_info)
-{
-    BOOL ret = FALSE;
-    unsigned int index = 0;
-    const char *path;
-
-    TRACE("(%p/%p, %s, 0x%08lx, %p)\n", pcs, pcs->handle, debugstr_w(filename), load_addr,
-            macho_info);
-
-    while (!ret && (path = wine_dll_enum_load_path( index++ )))
-    {
-        WCHAR *name;
-        unsigned len;
-
-        len = MultiByteToWideChar(CP_UNIXCP, 0, path, -1, NULL, 0);
-
-        name = HeapAlloc( GetProcessHeap(), 0,
-                          (len + lstrlenW(filename) + 2) * sizeof(WCHAR) );
-
-        if (!name) break;
-        MultiByteToWideChar(CP_UNIXCP, 0, path, -1, name, len);
-        strcatW( name, S_SlashW );
-        strcatW( name, filename );
-        ret = macho_load_file(pcs, name, load_addr, macho_info);
-        HeapFree( GetProcessHeap(), 0, name );
-    }
-    TRACE(" => %d\n", ret);
-    return ret;
-}
-
 /******************************************************************
  *              macho_search_and_load_file
  *
@@ -1628,7 +1589,7 @@ static BOOL macho_search_and_load_file(struct process* pcs, const WCHAR* filenam
         ret = search_unix_path(p, fallback, macho_load_file_cb, &load_params);
     }
     if (!ret && p == filename)
-        ret = macho_load_file_from_dll_path(pcs, filename, load_addr, macho_info);
+        ret = search_dll_path(filename, macho_load_file_cb, &load_params);
 
     return ret;
 }




More information about the wine-cvs mailing list