From: Davide Beatrici git@davidebeatrici.dev
--- dlls/dbghelp/path.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index 5b4172e4001..bf824a8c1a8 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -26,28 +26,13 @@ #include "image_private.h" #include "winnls.h" #include "winternl.h" + #include "wine/debug.h" +#include "wine/dir.h" #include "wine/heap.h"
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 == '\';} static inline BOOL is_sep(WCHAR ch) {return ch == '/' || ch == '\';}
@@ -765,12 +750,12 @@ BOOL search_dll_path(const struct process *process, const WCHAR *name, BOOL (*ma WCHAR env_name[64]; swprintf(env_name, ARRAY_SIZE(env_name), L"WINEDLLDIR%u", i); if (!(env = process_getenv(process, env_name))) return FALSE; - len = wcslen(env) + wcslen(pe_dir) + wcslen(name) + 2; + len = wcslen(env) + sizeof(PE_DIR) + wcslen(name) + 2; if (!(buf = heap_alloc(len * sizeof(WCHAR)))) return FALSE; if ((p = wcsrchr(name, '.')) && !lstrcmpW(p, L".so")) - swprintf(buf, len, L"%s%s\%s", env, so_dir, name); + swprintf(buf, len, L"%s\%s\%s", env, L"" SO_DIR, name); else - swprintf(buf, len, L"%s%s\%s", env, pe_dir, name); + swprintf(buf, len, L"%s\%s\%s", env, L"" PE_DIR, name); file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) {