permalink: spells/windows-dll-search-order
tags:
- OS/Windows
- Application/ProcMonThe search order varies depending on the state of SafeDllSearchMode.
Windows DLL search order if SafeDllSearchMode is enabled:
GetSystemDirectory())GetWindowsDirectory())Windows DLL search order if SafeDllSearchMode is disabled:
GetSystemDirectory())GetWindowsDirectory())Note that it seems more-or-less impossible to determine what DLLs an application is searching for without having SYSTEM access already (so tools like ProcMon can be run).