Perhaps next time ELF loader is modified, it'll be noticed if it breaks things.
See: - https://bugs.winehq.org/show_bug.cgi?id=55058 - https://bugs.winehq.org/show_bug.cgi?id=55096
Signed-off-by: Eric Pouech epouech@codeweavers.com
From: Eric Pouech epouech@codeweavers.com
Perhaps next time ELF loader is modified, it'll be noticed if it breaks things.
See: - https://bugs.winehq.org/show_bug.cgi?id=55058 - https://bugs.winehq.org/show_bug.cgi?id=55096
Signed-off-by: Eric Pouech epouech@codeweavers.com --- dlls/dbghelp/tests/dbghelp.c | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
diff --git a/dlls/dbghelp/tests/dbghelp.c b/dlls/dbghelp/tests/dbghelp.c index 6e3edc7c952..fc762760f85 100644 --- a/dlls/dbghelp/tests/dbghelp.c +++ b/dlls/dbghelp/tests/dbghelp.c @@ -300,6 +300,12 @@ static BOOL CALLBACK count_module_cb(const char* name, DWORD64 base, void* usr) return TRUE; }
+static BOOL CALLBACK count_native_module_cb(const char* name, DWORD64 base, void* usr) +{ + if (strstr(name, ".so") || strchr(name, '<')) (*(unsigned*)usr)++; + return TRUE; +} + static unsigned get_module_count(HANDLE proc) { unsigned count = 0; @@ -310,6 +316,19 @@ static unsigned get_module_count(HANDLE proc) return count; }
+static unsigned get_native_module_count(HANDLE proc) +{ + unsigned count = 0; + BOOL old, ret; + + old = SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES, TRUE); + ret = SymEnumerateModules64(proc, count_native_module_cb, &count); + ok(ret, "SymEnumerateModules64 failed: %lu\n", GetLastError()); + SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES, old); + + return count; +} + struct nth_module { HANDLE proc; @@ -745,6 +764,14 @@ static void test_loaded_modules(void) ret = SymRefreshModuleList(pi.hProcess); ok(ret || broken(GetLastError() == STATUS_PARTIAL_COPY /* Win11 in some cases */), "SymRefreshModuleList failed: %lu\n", GetLastError());
+ if (!strcmp(winetest_platform, "wine")) + { + unsigned count = get_native_module_count(pi.hProcess); + enum process_kind pcskind = get_process_kind(pi.hProcess); + todo_wine_if(pcskind != PCSKIND_32BIT && pcskind != PCSKIND_WINE_OLD_WOW64) + ok(count > 0, "Didn't find any native (ELF/Macho) modules\n"); + } + SymCleanup(pi.hProcess); TerminateProcess(pi.hProcess, 0);
@@ -796,6 +823,14 @@ static void test_loaded_modules(void) ret = SymRefreshModuleList(pi.hProcess); ok(ret, "SymRefreshModuleList failed: %lu\n", GetLastError());
+ if (!strcmp(winetest_platform, "wine")) + { + unsigned count = get_native_module_count(pi.hProcess); + enum process_kind pcskind = get_process_kind(pi.hProcess); + todo_wine_if(pcskind != PCSKIND_WINE_OLD_WOW64) + ok(count > 0, "Didn't find any native (ELF/Macho) modules\n"); + } + SymCleanup(pi.hProcess); TerminateProcess(pi.hProcess, 0); } @@ -851,6 +886,14 @@ static void test_loaded_modules(void) ret = SymRefreshModuleList(pi.hProcess); ok(ret, "SymRefreshModuleList failed: %lu\n", GetLastError());
+ if (!strcmp(winetest_platform, "wine")) + { + unsigned count = get_native_module_count(pi.hProcess); + enum process_kind pcskind = get_process_kind(pi.hProcess); + todo_wine_if(pcskind != PCSKIND_WINE_OLD_WOW64) + ok(count > 0, "Didn't find any native (ELF/Macho) modules\n"); + } + SymCleanup(pi.hProcess); TerminateProcess(pi.hProcess, 0); }
failures in pipeline occurs in msg.c, which looks unrelated to this patch (tests only)