03-07-2020, 06:34 AM
هذا مثال ، برنامج بلغة C
/***************************************** TLS Example Program
Compile With MSVC
********************************************/
#include
#pragma comment(linker, "/INCLUDE: tls_used")
void NTAPI TlsCallBac(PVOID h, DWORD dwReason, PVOID pv);
#pragma data_seg(".CRT$XLB")
PIMAGE_TLS_CALLBACK p_thread_callback = TlsCallBac;
#pragma data_seg()
void NTAPI TlsCallBac(PVOID h, DWORD dwReason, PVOID pv)
{
MessageBox(NULL, "In TLS", "In TLS", MB_OK);
return;
}
int main(int argc , char**argv)
{
MessageBox(NULL, "In Main", "In Main", MB_OK);
return 0;
}