如何在 DLLMain 中启动线程意味着 std :: thread - 从根本上说。No 表示 WinApi,STL 表示。当我在流程中运行该函数时,我会从该 DLL 调用应用程序崩溃。先感谢您。
此代码获取文件 (exe) 上的哈希和并将其写入文件。(* 。文本)。但是应用程序崩溃
void initialize()
{
string buffer;
thread t(calclulateHash, ref(buffer));
t.detach();
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
{
initialize();
break;
}
}
return true;
}