Ticket #358 (closed enhancement: fixed)
Link dynamically with IPHLPAPI.LIB (thanks Jim Gomez)
|Reported by:||bennylp||Owned by:||bennylp|
|Backport to 1.x milestone:||Backported:|
Description (last modified by bennylp) (diff)
Quoting Jim's email:
The major difference is the dynamic explicit run-time linking to the IpHlpApi.DLL, instead of the implicit linking that would normally be used with import libraries. The new version of the file will only load the DLL if it is actually used. Currently, the DLL is loaded and mapped into the program executable space at startup of the application, even though the DLL is never used by my application. Since there are only two functions that are needed from this DLL, it makes sense to only load it if they are needed.
I made this change because my application was crashing during shutdown. The crash was occurring deep within the shutdown code of the IpHlpApi.DLL. Since there wasn’t a clear way of debugging this, and my code didn’t actually need any of the functions from that DLL, I made the changes to the source file to explicitly link to it.