I\'m using the LoadLibrary function to load a DLL in Windows. My question is this: If I call this method more than once for the same DLL, do I get handles to different insta
If the DLL is already loaded, LoadLibrary
will simply return the address of the library in memory. However, DllMain
is not called again with DLL_PROCESS_ATTACH
when the second load is attempted. Handles in the sense of libraries are just memory locations, so the value you get the second time around should be the same as the first.
As far as linux SO files go, I don't see why they would load twice either. However, someone else will have to weigh in on this to give you a proper answer.