Hi
In Win2000, the ICMP functions exist in icmp.dll In WinXP, they are still there, but they have also been duplicated into iphlpapi.dll
How would one go about adding them to iphlpapi? Does one just duplicate all the code in the second DLL, or is there a way to have some function implemented once & then exported by multiple DLLs? (I'm a Wine newbie...)
Suppose one was to add code to iphlpapi's LibMain which did LoadLibrary & GetProcAddress to get the addresses of the functions in icmp.dll, and then the iphlpapi implementations just called the icmp.dll implementations? (I'm assuming doing a static import would result in some kind of name collission?)
Cheers Simon
On 6/10/06, Simon Kissane skissane@gmail.com wrote:
Suppose one was to add code to iphlpapi's LibMain which did LoadLibrary & GetProcAddress to get the addresses of the functions in icmp.dll, and then the iphlpapi implementations just called the icmp.dll implementations? (I'm assuming doing a static import would result in some kind of name collission?)
Bad, bad idea. In Windows programming, you *never* call LoadLibrary from DllMain. Inside of DllMain, you can't call anything which uses the loader lock, because the loader lock is already taken out. As best as I read the Wine code, it has the same limitation.
Carl Fongheiser
On Sat, 10 Jun 2006 21:37:01 -0500, Carl Fongheiser wrote:
Bad, bad idea. In Windows programming, you *never* call LoadLibrary from DllMain. Inside of DllMain, you can't call anything which uses the loader lock, because the loader lock is already taken out. As best as I read the Wine code, it has the same limitation.
Loader lock is a recursive critical section so it's OK to do that from the same thread and actually, the Wine loader code is written to allow that to work.
That said it's quite dangerous to do much of anything inside a DllMain because so much stuff in Win32 relies on multiple threads or inter-thread messaging behind your back.
thanks -mike
"Simon Kissane" skissane@gmail.com wrote:
In Win2000, the ICMP functions exist in icmp.dll In WinXP, they are still there, but they have also been duplicated into iphlpapi.dll
How would one go about adding them to iphlpapi? Does one just duplicate all the code in the second DLL, or is there a way to have some function implemented once & then exported by multiple DLLs? (I'm a Wine newbie...)
Actually that's not a Wine but a win32 concept about forwarding. For instance have a look how dlls/security forwards its entry points to secur32.dll.