From e6c6874ec323c9d657bfa9b69e04cb2a8cc1a522 Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Mon, 20 Aug 2018 13:42:54 -0500 Subject: [PATCH] ntdll: When an exception happens in DllMain(), print the code. Also print exceptions from TLS callbacks. Useful for debugging exceptions that prevent DLLs from loading. Signed-off-by: Chip Davis Signed-off-by: Alexandre Julliard --- dlls/ntdll/loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8d18af8b866..26b24310475 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1175,8 +1175,8 @@ static void call_tls_callbacks( HMODULE module, UINT reason ) } __EXCEPT_ALL { - TRACE_(relay)("\1exception in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", - callback, module, reason_names[reason] ); + TRACE_(relay)("\1exception %08x in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", + GetExceptionCode(), callback, module, reason_names[reason] ); return; } __ENDTRY @@ -1222,9 +1222,9 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved } __EXCEPT_ALL { - TRACE_(relay)("\1exception in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", - entry, module, reason_names[reason], lpReserved ); status = GetExceptionCode(); + TRACE_(relay)("\1exception %08x in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", + status, entry, module, reason_names[reason], lpReserved ); } __ENDTRY