This is probably something obvious but it doesn't make much sense to me. I'm trying to create a dll which is to be injected into a game process using C++. I have read that I shouldn't be calling anything like CreateThread from this method because it's 'dangerous'. Is it still dangerous if I have another method like this? (pseudo):
foo()
{
CreateThread();
}
DllMain(reason)
{
if(reason == attach)
{
foo();
}
}
If this is not safe, how exactly should this be done?