This is really just a corollary to Why are DLLs unloaded in the “wrong” order. Exactly the same logic that explains why DLLs are unloaded in the “wrong” order also explains why they are uninitialized in the “wrong” order. Once you understand the first issue, the second comes for free; just change DLL_PROCESS_DETACH
to DLL_THREAD_DETACH
in your analysis.
Apply the logic to the scenario posed in this comment and you’ll see why it too is flawed.
0 comments