1 DllMain()函数是由主线程来执行的.
2 DllMain()要返回true, 且只在第一次映射时被调用.
3
If a process terminates because some thread in the system calls TerminateProcess , the system does not call the DLL's DllMain function with a value of DLL_PROCESS_DETACH . This means that any DLLs mapped into the process' address space do not have a chance to perform any cleanup before the process terminates. This can result in the loss of data. You should use the TerminateProcess function only as a last resort!
4
DLL_THREAD_ATTACH 的初始化是为了什么呢? 应该是为了多线程. c/c++运行时库就有单线程和多线程两个版本.
差别和这个有关系. 所以如果你的DLL要提供给多线程使用的话,你就需要好好处理这个部分了.