Xtrap terminates thread created in DllMain

Posts 1–2 of 2 · Page 1 of 1
Xtrap terminates thread created in DllMain
Well, as usual, i put CreateThread in DllMain like this:
Code:
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	DisableThreadLibraryCalls(hModule);
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		CreateThread(NULL, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(MainThread), NULL, 0, NULL);
		break;
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}
The problem is: my thread had started for a while then got terminated. I know Xtrap did this because I tried with older version of Xtrap and the thread runs normally.
Could anyone help me with this problem? Thanks!
I am using createthread(), i have no problems with it.
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us