MCPcopy Create free account
hub / github.com/DrewKestell/BloogBot / DllMain

Function DllMain

Loader/dllmain.cpp:219–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
220{
221 g_myDllModule = hDll;
222 if (dwReason == DLL_PROCESS_ATTACH)
223 {
224 LoadClr();
225 }
226 else if (dwReason == DLL_PROCESS_DETACH)
227 {
228 if (g_clrHost)
229 {
230 // We eventually 'die' so we make sure we stop the CLR.
231 g_clrHost->Stop();
232 // And release it.
233 g_clrHost->Release();
234 }
235
236 // Yes yes, I know. I should be using _endthread(ex)
237 // however, I can't. Since we don't want the thread killed until we exit.
238 if (g_hThread)
239 {
240 TerminateThread(g_hThread, 0);
241 CloseHandle(g_hThread);
242 }
243 }
244
245 return TRUE;
246}

Callers

nothing calls this directly

Calls 3

LoadClrFunction · 0.85
ReleaseMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected