Module: wine Branch: master Commit: e8bba26c8062565ff06f68969dd32389f975471a URL: http://source.winehq.org/git/wine.git/?a=commit;h=e8bba26c8062565ff06f68969d...
Author: Dmitry Timoshkov dmitry@codeweavers.com Date: Tue Mar 13 18:21:37 2007 +0800
ntdll: Catch the exceptions in the TLS callback like Windows does.
---
dlls/ntdll/loader.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 7ff3ca1..441db92 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -798,7 +798,18 @@ static void call_tls_callbacks( HMODULE module, UINT reason ) if (TRACE_ON(relay)) DPRINTF("%04x:Call TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] ); - (*callback)( module, reason, NULL ); + __TRY + { + (*callback)( module, reason, NULL ); + } + __EXCEPT(NULL) + { + if (TRACE_ON(relay)) + 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)) DPRINTF("%04x:Ret TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] );