Hey,
I have 3 dlls A,B and C which I am trying to use from Unity but I am having an issue.
DLL A depends on B and B depends on C. The linking is run-time so A uses LoadLibrary for B and B does the same for C also the dlls use GetProcAddress to load specific functions from each dll.
When I test those 3 dll's outside of Unity in a test project, everything seems to be working fine, whilst, when I import them to Unity the following happens:
First, Unity Loads A dll's functions (e.g.)
`[DllImport(dllName: "Story", CallingConvention = CallingConvention.Cdecl)]
public static extern bool release();
`
Afterwards dll A tries to load dll's B functions. While LoadLibrary(B) works on A (doesn't return NULL), GetProcAddress(Bfunction) fails with error code 127 and thus A cannot load B functions from Unity.
As I mentioned earlier, the same setup works outside of Unity.
Any logic or reasoning behind this? Even better, any solutions to this matter?
Thanks in advance.
↧