Greetings. There is a certain function that receives the hash sum of the file (exe) and writes it to a file. It is launched in the stream, but the application from where it starts is crashing. I would like to know how to properly run the function in the stream so that the application does not crash.
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; }
ref(buffer)? Do you understand what this line does? - Pavel Mayorov