diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8a43310b925..831f04980ee 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -49,6 +49,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay); WINE_DECLARE_DEBUG_CHANNEL(snoop); WINE_DECLARE_DEBUG_CHANNEL(loaddll); WINE_DECLARE_DEBUG_CHANNEL(imports); +WINE_DECLARE_DEBUG_CHANNEL(pid); #ifdef _WIN64 #define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232) @@ -1036,8 +1037,12 @@ static void call_tls_callbacks( HMODULE module, UINT reason ) for (callback = (const PIMAGE_TLS_CALLBACK *)dir->AddressOfCallBacks; *callback; callback++) { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] ); + } __TRY { call_dll_entry_point( (DLLENTRYPROC)*callback, module, reason, NULL ); @@ -1045,14 +1050,22 @@ static void call_tls_callbacks( HMODULE module, UINT reason ) __EXCEPT_ALL { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:exception in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), callback, module, reason_names[reason] ); + } return; } __ENDTRY if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] ); + } } } @@ -1079,6 +1092,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) ); memcpy( mod_name, wm->ldr.BaseDllName.Buffer, len ); mod_name[len / sizeof(WCHAR)] = 0; + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call PE DLL (proc=%p,module=%p %s,reason=%s,res=%p)\n", GetCurrentThreadId(), entry, module, debugstr_w(mod_name), reason_names[reason], lpReserved ); @@ -1095,8 +1110,12 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved __EXCEPT_ALL { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:exception in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", GetCurrentThreadId(), entry, module, reason_names[reason], lpReserved ); + } status = GetExceptionCode(); } __ENDTRY @@ -1105,9 +1124,13 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved to the dll. We cannot assume that this module has not been deleted. */ if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret PE DLL (proc=%p,module=%p %s,reason=%s,res=%p) retval=%x\n", GetCurrentThreadId(), entry, module, debugstr_w(mod_name), reason_names[reason], lpReserved, retv ); + } else TRACE("(%p,%s,%p) - RETURN %d\n", module, reason_names[reason], lpReserved, retv ); return status;