MCPcopy Create free account
hub / github.com/cinit/WSAPatch / DllMain

Function DllMain

WsaPatch.cpp:255–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) {
256 // Perform actions based on the reason for calling.
257 switch (fdwReason) {
258 case DLL_PROCESS_ATTACH:
259 return wsapatch::OnLoad(hInstDLL);
260 case DLL_THREAD_ATTACH:
261 case DLL_THREAD_DETACH:
262 // no-op
263 break;
264 case DLL_PROCESS_DETACH:
265 if (lpvReserved != nullptr) {
266 // do not do cleanup if process termination scenario
267 break;
268 }
269 wsapatch::OnUnload();
270 break;
271 default:
272 break;
273 }
274 return true;
275}

Callers

nothing calls this directly

Calls 2

OnLoadFunction · 0.85
OnUnloadFunction · 0.85

Tested by

no test coverage detected