[Winpcap-users] WanPacket.cpp, DllMain, and LoadLibrary

Bryan Kadzban bryan at kadzban.is-a-geek.net
Mon Aug 29 16:44:02 GMT 2005


On Mon, Aug 29, 2005 at 09:17:03AM -0700, Gianluca Varenni wrote:
> 
> The reason for that "strange" LoadLibrary is to fix a bug in the Microsoft 
> NetMon COM component (which is used to capture from Dialup/VPN adapters). 
> Basically, that DLL should be manually loaded before any attempt to call 
> one of the NetMon functions, otherwise you'll experience random Access 
> violation crashes. This "dirty" solution was provided directly by the 
> Microsoft Support to one of the WinPcap users,

Did the solution require calling LoadLibrary *during DllMain*, or only
at some point before calling the NetMon stuff?  It ought to be easy
enough to keep track of whether it's been loaded in each of the
WanPacket functions, and load it if not.  I assume it still has to be
loaded as long as the WanPacket code is in use.

(Or, you could just get Microsoft to fix the bug in their COM code --
heh, yeah, right.  ;-) )

If it's required to happen during DllMain, then it wouldn't really
surprise me (that they'd violate one of their own rules to fix something
else that's broken), either.

> I plan to add a fix to this in the next weeks, and maybe put a test
> version of WanPacket.dll on the website.

OK, great!  Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winpcap.org/pipermail/winpcap-users/attachments/20050829/f8f4ca1a/attachment-0001.pgp


More information about the Winpcap-users mailing list