Summery

Dynamic Link Libraries (DLL) provide functionality to programs or the Windows operating system. DLLs contain code or resources, such as icon files, for other executable files or objects to use. These libraries provide a way for developers to use and integrate already existing functionality without reinventing the wheel.

On Unix systems, these files are called Shared Objects.

Search order

DLL search order is defined by Microsoft and determines what to inspect first when searching for DLLs. By default, all current Windows versions have safe DLL search mode enabled.
It is often aboves for privlege escalation, especially with DLL Hijacking.

The standard search order (safe search on):

1. The directory from which the application loaded.
2. The system directory.
3. The 16-bit system directory.
4. The Windows directory. 
5. **The current directory.**
6. The directories that are listed in the PATH environment variable.

And this is the old one (safe search off)

1. The directory from which the application loaded.
2. **The current directory.**
3. The system directory.
4. The 16-bit system directory.
5. The Windows directory. 
6. The directories that are listed in the PATH environment variable.