Remove current working directory from DLL search

Global setting

The CWDIllegalInDllSearch registry entry can be used to remove the current working directory (CWD) from the DLL search order. I highly recommend setting this registry entry as it protects from DLL hijacking attacks:


Exceptions for specific applications

Some applications do not work properly when the CWDIllegalInDllSearch registry entry is used. Such applications typically do not even start and might silently terminate without any error message.

Fortunately, you can use application-specific settings which take precedence over the global setting. I know of the following applications that require such a setting:

Plants vs. Zombies


Age of Empires II: The Conquerors