The callExtension scripting command allows mod makers to call a method in an external DLL.
However, if that DLL itself has a dependency on another DLL, the game does correctly search for it within the current path.
{F18190}
The callExtension scripting command allows mod makers to call a method in an external DLL.
However, if that DLL itself has a dependency on another DLL, the game does correctly search for it within the current path.
{F18190}
Extract both dlls from the attached archive into
...\Documents\Arma 3 Alpha\Arma3TestExtension1
Start arma3 using "-mod=Arma3TestExtension1"
Create a new mission in the editor and in init.sqf place the command
"Arma3TestExtension1" callExtension "an arbitrary command string";
You should see the game crash
It's clear from the output of ProcMon (edited) that the current path is not being searched. Instead the dependency is assumed to live in its own folder in the main game installation folder...
16:46:27.7771128 arma3.exe 10892 Load Image D:\Users\user\Documents\Arma 3 Alpha\Arma3TestExtension1\Arma3TestExtension1.dll SUCCESS Image Base: 0x16440000, Image Size: 0xb000
...
16:46:27.8619788 arma3.exe 10892 QueryOpen D:\Program Files (x86)\Steam\steamapps\common\Arma 3\netStuff.dll NAME NOT FOUND
16:46:27.8620583 arma3.exe 10892 QueryOpen D:\Program Files (x86)\Steam\steamapps\common\Arma 3\netstuff\netStuff.dll NAME NOT FOUND
16:46:27.8621299 arma3.exe 10892 QueryOpen D:\Program Files (x86)\Steam\steamapps\common\Arma 3\netStuff.exe NAME NOT FOUND
16:46:27.8622006 arma3.exe 10892 QueryOpen D:\Program Files (x86)\Steam\steamapps\common\Arma 3\netstuff\netStuff.exe NAME NOT FOUND
Workarounds
I believe you can find the path of your dll from other win32 functions using the hmodule passed into the winmain.
Not BIs fault.. Thats just the behaviour of windows LoadLibrary (I suppose Linux does the same)
But LoadLibrary is searching in the working directory for files to load so if you change the working directory as soon as your dll gets attached (Not sure if thats possible) LoadLibrary will find your dependencys.
Also if a DLL dependency cannot be loaded LoadLibrary fails to load your extension. It shouldn't crash. Didn't try to reproduce.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686203(v=vs.85).aspx