Closed phra closed 3 years ago
alternative fix is to create a new thread in dllmain like so
.... HANDLE hNewThread; DWORD dwNewThread;
void dostuff() { stuff } .....
DWORD WINAPI MyThread(LPVOID lpParam) { dostuff(); return 0; }
case DLL_PROCESS_ATTACH: { hNewThread = CreateThread(NULL, 0, MyThread, NULL, 0, &dwNewThread); CloseHandle(hNewThread); break; }
I am creating a thread in DllMain
but without a dummy export rundll32
terminates immediately.
to fix the issue:
DllMain
StartW
rundll32 calc.dll,StartW