Hi,
Please help me sort out the following doubts on dlls on win32 platform.

1)A process calling loadlibrary() API loads the dll from the disk to the memory(to its address space),if another process now calls the API again with the same path to the dll as earlier, will the dll be loaded again from the disk to a new adress in the second process' address space?Or the previously loaded dll be reused?

For the documentation pertaining to Windows CE(i dont know what it is) msdn says that a reloading the dll is not required.Is the behaviour different for normal win32?

2)If there are no multiple loads of the dll, then doing a FreeLibrary() from one process may affect the other process which might be using the dll at that point of time.So is it the responsibility of the developer to maintain a ref counting mechanism for the dll(in form of some global varible in the dll) and check the ref count before freeing a dll?

3)If there are multiple loads then how do things work in the COM scenario?
Because there is a ref count maintained for the COM dll loaded and used by two differnt processes.Once the ref count drops to zero the com library frees the dll from the memory.
This means that there is only one COM dll instance present in the memory if two processes use the same component.
How is this made possible coz internally COM implementation also uses loadlibrary to load the COM dll?

Please let me know your views on the same.