Paul Gofman : ntdll: Call TLS callbacks also for main exe on thread attach.

Alexandre Julliard julliard at winehq.org
Wed Jun 24 15:47:35 CDT 2020


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

Author: Paul Gofman <pgofman at codeweavers.com>
Date:   Wed Jun 24 23:30:05 2020 +0300

ntdll: Call TLS callbacks also for main exe on thread attach.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49007
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49098
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49041
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/loader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 42cdc62802..bc437d1a58 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -3469,6 +3469,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
         if ((status = alloc_thread_tls()) != STATUS_SUCCESS)
             NtTerminateThread( GetCurrentThread(), status );
         thread_attach();
+        if (wm->ldr.TlsIndex != -1) call_tls_callbacks( wm->ldr.DllBase, DLL_THREAD_ATTACH );
     }
 
     RtlLeaveCriticalSection( &loader_section );




More information about the wine-cvs mailing list