t7x/src/tlsdll/dllmain.cpp
Maurice Heumann 0abeeaed28 Fix tls dll
2022-12-03 21:52:04 +01:00

21 lines
380 B
C++

#define WIN32_LEAN_AND_MEAN
#include "Windows.h"
#define TLS_PAYLOAD_SIZE 0x2000
thread_local char tls_data[TLS_PAYLOAD_SIZE];
__declspec(dllexport) void* get_tls_data()
{
return &tls_data[0];
}
int WINAPI _DllMainCRTStartup(const HMODULE module, const unsigned long reason, void*)
{
if (reason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(module);
}
return 1;
}