Keeping the DLL loaded
-
Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K
no, a DLL always requires a process to be loaded into else into which memory address space would it go ? Why would you want to do this ?
Jonathan Wilkes Darka[Xanya.net]
-
Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K
SanjaySMK wrote:
Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How?
Until
FreeLibrary()
is called, it will remain in your process' address space.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K
I think that if the process which is using DLL still exist, then the dll will also remain in memory whether you use it or not. To Remove the dll, use FreeLibrary. But that will only remove dll loaded with LoadLibrary. But what you will achieve with that ?
-
Hello, Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How? Software Developer Sanjay K
From the MSDN: Each process maintains a reference count for each loaded library module. This reference count is incremented each time LoadLibrary is called and is decremented each time FreeLibrary is called. A DLL module loaded at process initialization due to load-time dynamic linking has a reference count of one. This count is incremented if the same module is loaded by a call to LoadLibrary.