Module: wine Branch: master Commit: f2838cc1d4c63c9f0987b4e4db1e397d588c2349 URL: https://source.winehq.org/git/wine.git/?a=commit;h=f2838cc1d4c63c9f0987b4e4d...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Apr 28 11:41:51 2021 +0200
dbghelp: Look for .so files in the architecture-specific directory.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dbghelp/path.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index b281c19de88..ba757a55b0c 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -33,14 +33,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
#ifdef __i386__ static const WCHAR pe_dir[] = L"\i386-windows"; +static const WCHAR so_dir[] = L"\i386-unix"; #elif defined __x86_64__ static const WCHAR pe_dir[] = L"\x86_64-windows"; +static const WCHAR so_dir[] = L"\x86_64-unix"; #elif defined __arm__ static const WCHAR pe_dir[] = L"\arm-windows"; +static const WCHAR so_dir[] = L"\arm-unix"; #elif defined __aarch64__ static const WCHAR pe_dir[] = L"\aarch64-windows"; +static const WCHAR so_dir[] = L"\aarch64-unix"; #else static const WCHAR pe_dir[] = L""; +static const WCHAR so_dir[] = L""; #endif
static inline BOOL is_sepA(char ch) {return ch == '/' || ch == '\';} @@ -769,16 +774,16 @@ BOOL search_dll_path(const struct process *process, const WCHAR *name, BOOL (*ma if (!(env = process_getenv(process, env_name))) return FALSE; len = wcslen(env) + wcslen(pe_dir) + wcslen(name) + 2; if (!(buf = heap_alloc(len * sizeof(WCHAR)))) return FALSE; - if (!(p = wcsrchr(name, '.')) || lstrcmpW(p, L".so")) - { + if ((p = wcsrchr(name, '.')) && !lstrcmpW(p, L".so")) + swprintf(buf, len, L"%s%s\%s", env, so_dir, name); + else swprintf(buf, len, L"%s%s\%s", env, pe_dir, name); - file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (file != INVALID_HANDLE_VALUE) - { - ret = match(param, file, buf); - CloseHandle(file); - if (ret) goto found; - } + file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (file != INVALID_HANDLE_VALUE) + { + ret = match(param, file, buf); + CloseHandle(file); + if (ret) goto found; } swprintf(buf, len, L"%s\%s", env, name); file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);