Jacek Caban (@jacek) commented about dlls/ntdll/loader.c:
if (TRACE_ON(snoop)) { - const WCHAR *user = current_importer ? current_importer->modref->ldr.BaseDllName.Buffer : NULL; + const WCHAR *user = get_last_static_importer_name(); proc = SNOOP_GetProcAddress( module, exports, exp_size, proc, ordinal, user ); } if (TRACE_ON(relay)) { - const WCHAR *user = current_importer ? current_importer->modref->ldr.BaseDllName.Buffer : NULL; + const WCHAR *user = get_last_static_importer_name();
With the current approach, is relay exclude from effective even for `GetProcAddress` calls inside `DllMain`? My guess is that this is more of a side effect than an intentional behavior, and not something we necessarily need to preserve. Since this mechanism can't be fully precise (`DllMain` might call functions from a different module) and we don't use such `GetProcAddress` calls inside Wine DLLs, where this feature is typically applied, I'm wondering if we could simplify it by treating `is_dynamic` as a `NULL` user here. Perhaps we could even pass an argument like `user_modref` and exclude `LdrGetProcedureAddress` from the relay exclude from mechanism by passing `NULL`? I haven’t tried implementing this to confirm, but I’m curious if you’ve considered it. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7#note_93657