In Windows Server 2016 or Windows 10, if you do not grant dynamic-link library (DLL) access to the process token itself when you use the LoadLibrary function to load the DLL, you receive a "STATUS_DLL_NOT_FOUND" error message on impersonate threads.
This behavior occurs for the following reasons:
- It's assumed that all Windows-based operating systems have access rights to the DLL that's referred to by the process token.
- Regardless of the condition that's described in the preceding bullet point, this problem is more obvious in Windows 10 and Windows Server 2016 than in earlier versions of Windows.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.