I read this one What is the DLL loading behavior when using DllImport[] in C#?, and it partially ask my question, still I'm in search of a more detailed answer. I know pretty well how dlls worked back in the days of C/C++ applications, now I'm trying to understand if what I've been tasked to do is feasible.
I've got an old c dll which I have to use in the context of a multi threaded C# environment. The dll is thought for a single thread environment, and its (170!!!) exported functions cover a wide kind of types (basic types, pointers of every kind, HWNDs, handles...)
What I'm trying to better understand is in which way a C# environment load a native/unmanaged dll: in a C application I'd be explicitly using LoadLibrary, thus knowing and having controll on when (and where, in which thread) the dll is loaded and unloaded; what happens in C#, instead?