Chip Davis : ntdll: When an exception happens in DllMain(), print the code.

Alexandre Julliard julliard at winehq.org
Tue Aug 21 16:49:02 CDT 2018


Module: wine
Branch: master
Commit: e6c6874ec323c9d657bfa9b69e04cb2a8cc1a522
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=e6c6874ec323c9d657bfa9b69e04cb2a8cc1a522

Author: Chip Davis <cdavis at codeweavers.com>
Date:   Mon Aug 20 13:42:54 2018 -0500

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 <cdavis at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 8d18af8..26b2431 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
 




More information about the wine-cvs mailing list