TLS -Rückrufe nicht zu einer Bibliothek hinzufügenC++

Programme in C++. Entwicklerforum
Anonymous
 TLS -Rückrufe nicht zu einer Bibliothek hinzufügen

Post by Anonymous »

Im Grunde möchte ich meine TLS -Rückrufe in einer LIB haben, in der die PPL, die meine Bibliothek verwenden// .cpp file

void ProtectionSDK::TlsCallback(PVOID hModule, DWORD reason, PVOID reserved)
{
if (reason == DLL_PROCESS_ATTACH) {
if (anti_debug::perform_all_checks()) {
ExitProcess(0); // Terminate the process if a debugger is detected
}
}
}

// Define the TLS callback section
#pragma section(".CRT$XLB", long, read)
__declspec(allocate(".CRT$XLB")) PIMAGE_TLS_CALLBACK _tls_callback[] = { ProtectionSDK::TlsCallback, nullptr };

// Ensure the linker includes the TLS callback
#pragma comment(linker, "/INCLUDE:_tls_callback")
< /code>
// .h file
static void NTAPI TlsCallback(PVOID hModule, DWORD reason, PVOID reserved);
< /code>
I get unresolved external symbol _tls_callback

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post