DLLPROCESSDETACH
DLL_PROCESS_DETACH (often referred to as DLL_PROCESS_DETACH in documentation) is a constant used as the fdwReason parameter in the DllMain entry point of a Windows dynamic-link library. It signals that the DLL is being unloaded from the current process. This can occur when the process is terminating or when the application explicitly calls FreeLibrary to unload the DLL.
When DLL_PROCESS_DETACH is received, the DLL should perform any necessary per-process cleanup, such as releasing resources
Detachment can occur for two scenarios: explicit unloading via FreeLibrary, or process termination where the operating
In summary, DLL_PROCESS_DETACH is a key lifecycle signal indicating a DLL is being removed from a process,