The Best Practices for Creating DLLs whitepaper is the Microsoft Corporation's original guidance laying out DLL best practices for the Windows platform, namely regarding DllMain.
The document was authored by engineers who were assigned to work on the DLL loader at Microsoft and published in cooperation with the program manager (PM) who owned the DLL loader (blog announcement #2).
A notable fact about the whitepaper's top reference to blog entries in The Old New Thing: Author Raymond Chen did not approve of his work being cited for this whitepaper.
Note: This old document states the following about loader lock: "Any function that must read or modify the per-process library-loader data structures must acquire this lock before performing such an operation" (in addition to protecting module initialization/deinitialization). This fact was only true of the legacy Windows loader (e.g. see ReactOS code based on the reverse engineered Windows Server 2003 loader). The modern Windows loader protects library-loader data structures using the LdrpModuleDatatableLock lock. The age of this document also makes it inapplicable to the modern Windows loader in other ways (this amendment is by no means comprehensive).