When the Dll_process_attach process starts or calls LoadLibrary, the DLL maps to the address space of the current process, during which the DLL initializes the instance data
The Dll_process_detach DLL is being detached from the address space of the process, which may be the process itself exiting or calling FreeLibrary, in which case the DLL may not initialize any instances.
The Dll_thread_attach process creates a new thread. At this point, the system invokes all DLL entry functions associated with the process. This call is made in the context of the new thread and is used to allocate thread-specific data
Dll_thread_detach a thread is exiting, in which case the DLL releases thread-specific initialization data.
WARNING: Call TerminateThread () does not call Dll_thread_detach when terminating a thread abnormally
Entry and exit functions for DLLs