https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28a0aa9ae84cacc71f9ed…
commit 28a0aa9ae84cacc71f9edae33b4de1e3697f9e76
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Thu Jul 4 23:06:51 2019 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Jul 6 11:37:30 2019 +0200
[CRT] Remove mingwm10.dll usage in tls support code
CORE-15491
---
sdk/lib/crt/startup/tlsmthread.c | 11 -----------
sdk/lib/crt/startup/tlssup.c | 30 ------------------------------
2 files changed, 41 deletions(-)
diff --git a/sdk/lib/crt/startup/tlsmthread.c b/sdk/lib/crt/startup/tlsmthread.c
index fa11171fc48..9e77c34d7f1 100644
--- a/sdk/lib/crt/startup/tlsmthread.c
+++ b/sdk/lib/crt/startup/tlsmthread.c
@@ -20,11 +20,6 @@ extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void
*));
#ifndef _WIN64
-#define MINGWM10_DLL "mingwm10.dll"
-typedef int (*fMTRemoveKeyDtor)(DWORD key);
-typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
-extern fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
-extern fMTKeyDtor __mingw_gMTKeyDtor;
extern int __mingw_usemthread_dll;
#endif
@@ -36,8 +31,6 @@ __mingwthr_remove_key_dtor (DWORD key)
#endif
return ___w64_mingwthr_remove_key_dtor (key);
#ifndef _WIN64
- if (__mingw_gMTRemoveKeyDtor)
- return (*__mingw_gMTRemoveKeyDtor) (key);
return 0;
#endif
}
@@ -51,10 +44,6 @@ __mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
if (!__mingw_usemthread_dll)
#endif
return ___w64_mingwthr_add_key_dtor (key, dtor);
-#ifndef _WIN64
- if (__mingw_gMTKeyDtor)
- return (*__mingw_gMTKeyDtor) (key, dtor);
-#endif
}
return 0;
}
diff --git a/sdk/lib/crt/startup/tlssup.c b/sdk/lib/crt/startup/tlssup.c
index 220678c1c15..e52a554536c 100644
--- a/sdk/lib/crt/startup/tlssup.c
+++ b/sdk/lib/crt/startup/tlssup.c
@@ -81,13 +81,7 @@ static __CRT_THREAD TlsDtorNode dtor_list_head;
extern int _CRT_MT;
#ifndef _WIN64
-#define MINGWM10_DLL "mingwm10.dll"
-typedef int (*fMTRemoveKeyDtor)(DWORD key);
-typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
-fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
-fMTKeyDtor __mingw_gMTKeyDtor;
int __mingw_usemthread_dll;
-static HANDLE __mingw_mthread_hdll;
#endif
BOOL WINAPI __dyn_tls_init (HANDLE, DWORD, LPVOID);
@@ -98,30 +92,6 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
_PVFV *pfunc;
uintptr_t ps;
-#ifndef _WIN64
- if (_winmajor < 4)
- {
- __mingw_usemthread_dll = 1;
- __mingw_mthread_hdll = LoadLibrary (MINGWM10_DLL);
- if (__mingw_mthread_hdll != NULL)
- {
- __mingw_gMTRemoveKeyDtor = (fMTRemoveKeyDtor) GetProcAddress (__mingw_mthread_hdll,
"__mingwthr_remove_key_dtor");
- __mingw_gMTKeyDtor = (fMTKeyDtor) GetProcAddress (__mingw_mthread_hdll,
"__mingwthr_key_dtor");
- }
- if (__mingw_mthread_hdll == NULL || !__mingw_gMTRemoveKeyDtor ||
!__mingw_gMTKeyDtor)
- {
- __mingw_gMTKeyDtor = NULL;
- __mingw_gMTRemoveKeyDtor = NULL;
- if (__mingw_mthread_hdll)
- FreeLibrary (__mingw_mthread_hdll);
- __mingw_mthread_hdll = NULL;
- _CRT_MT = 0;
- return TRUE;
- }
- _CRT_MT = 1;
- return TRUE;
- }
-#endif
/* We don't let us trick here. */
if (_CRT_MT != 2)
_CRT_MT = 2;