mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-16 11:31:19 +00:00
33 lines
661 B
C++
33 lines
661 B
C++
#include <windows.h>
|
|
|
|
BOOL WINAPI DllMain(
|
|
HINSTANCE hinstDLL, // handle to DLL module
|
|
DWORD fdwReason, // reason for calling function
|
|
LPVOID lpvReserved) // reserved
|
|
{
|
|
// Perform actions based on the reason for calling.
|
|
switch (fdwReason) {
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
break;
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
// Do thread-specific initialization.
|
|
break;
|
|
|
|
case DLL_THREAD_DETACH:
|
|
// Do thread-specific cleanup.
|
|
break;
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
if (lpvReserved != nullptr) {
|
|
break; // do not do cleanup if process termination scenario
|
|
}
|
|
|
|
// Perform any necessary cleanup.
|
|
break;
|
|
}
|
|
return TRUE; // Successful DLL_PROCESS_ATTACH.
|
|
}
|