Where does Unity5 look for native plugin dependencies in the editor on Windows?

I am running Unity5.1.1 on Windows. I have a native dll for a plugin I made, plugin.dll, but it depends on another native cpp dll dependency.dll, so when I try to use plugin.dll in Unity I get “missing dll exception” which is because of the missing dependency. In Unity4, I fixed this problem by placing plugin.dll in the appropriate plugins folder, and dependency.dll in the root folder of the project where the Assets folder is; however this solution does not work for me with the same plugin and dependency in a Unity5 project.

What does work however, is building the game and placing dependency.dll next to the game executable. So I just cannot get the dependency to be found by unity in the editor.

I also tried placing dependency.dll in the plugins folder besides plugin.dll, that also did not work.

I have both 32bit and 64bit versions of plugin.dll and dependency.dll appropriately placed in Assets/plugins/x86 and Assets/plugins/x86_64.

So, does anyone know where does Unity5 looks for native plugin dependencies in the editor on Windows?

From what I know (and from the testing) it looks like it first try to look in unity.exe origin path, then SysWOW64 (if you’re on 64 bit), then System, then Windows, then in the project root dir. So placing the .dll in the project root dir should suffice. If you put the .dll to the unity.exe folder (unity install path), it should work in every case (for testing only). Also be aware, that if the dll with the same name exist in the System dir, it would be loaded first.
You could use ProcessMonitor to monitor unity.exe and find which paths it checks when loading your dlls.