本文整理汇总了C++中CPalThread::GetThreadType方法的典型用法代码示例。如果您正苦于以下问题:C++ CPalThread::GetThreadType方法的具体用法?C++ CPalThread::GetThreadType怎么用?C++ CPalThread::GetThreadType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPalThread
的用法示例。
在下文中一共展示了CPalThread::GetThreadType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOADCallDllMain
void LOADCallDllMain(DWORD dwReason, LPVOID lpReserved)
{
MODSTRUCT *module = nullptr;
BOOL InLoadOrder = TRUE; /* true if in load order, false for reverse */
CPalThread *pThread;
pThread = InternalGetCurrentThread();
if (UserCreatedThread != pThread->GetThreadType())
{
return;
}
/* Validate dwReason */
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
ASSERT("got called with DLL_PROCESS_ATTACH parameter! Why?\n");
break;
case DLL_PROCESS_DETACH:
ASSERT("got called with DLL_PROCESS_DETACH parameter! Why?\n");
InLoadOrder = FALSE;
break;
case DLL_THREAD_ATTACH:
TRACE("Calling DllMain(DLL_THREAD_ATTACH) on all known modules.\n");
break;
case DLL_THREAD_DETACH:
TRACE("Calling DllMain(DLL_THREAD_DETACH) on all known modules.\n");
InLoadOrder = FALSE;
break;
default:
ASSERT("LOADCallDllMain called with unknown parameter %d!\n", dwReason);
return;
}
LockModuleList();
module = &exe_module;
do
{
if (!InLoadOrder)
module = module->prev;
if (module->threadLibCalls)
{
if (module->pDllMain)
{
LOADCallDllMainSafe(module, dwReason, lpReserved);
}
}
if (InLoadOrder)
module = module->next;
} while (module != &exe_module);
UnlockModuleList();
}
示例2: LOADCallDllMain
void LOADCallDllMain(DWORD dwReason, LPVOID lpReserved)
{
MODSTRUCT *module = NULL;
BOOL InLoadOrder = TRUE; /* true if in load order, false for reverse */
CPalThread *pThread;
pThread = InternalGetCurrentThread();
if (UserCreatedThread != pThread->GetThreadType())
{
return;
}
/* Validate dwReason */
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
ASSERT("got called with DLL_PROCESS_ATTACH parameter! Why?\n");
break;
case DLL_PROCESS_DETACH:
ASSERT("got called with DLL_PROCESS_DETACH parameter! Why?\n");
InLoadOrder = FALSE;
break;
case DLL_THREAD_ATTACH:
TRACE("Calling DllMain(DLL_THREAD_ATTACH) on all known modules.\n");
break;
case DLL_THREAD_DETACH:
TRACE("Calling DllMain(DLL_THREAD_DETACH) on all known modules.\n");
InLoadOrder = FALSE;
break;
default:
ASSERT("LOADCallDllMain called with unknown parameter %d!\n", dwReason);
return;
}
LockModuleList();
module = &exe_module;
do {
if (!InLoadOrder)
module = module->prev;
if (module->threadLibCalls)
{
if (module->pDllMain)
{
#if !_NO_DEBUG_MESSAGES_
/* reset ENTRY nesting level back to zero while inside the callback... */
int old_level;
old_level = DBG_change_entrylevel(0);
#endif /* !_NO_DEBUG_MESSAGES_ */
{
// This module may be foreign to our PAL, so leave our PAL.
// If it depends on us, it will re-enter.
PAL_LeaveHolder holder;
module->pDllMain(module->hinstance, dwReason, lpReserved);
}
#if !_NO_DEBUG_MESSAGES_
/* ...and set nesting level back to what it was */
DBG_change_entrylevel(old_level);
#endif /* !_NO_DEBUG_MESSAGES_ */
}
}
if (InLoadOrder)
module = module->next;
} while (module != &exe_module);
UnlockModuleList();
}