[Winpcap-users] dynamic loading of wpcap.dll

Marcel van Lieshout marcel at hmcs.nl
Sat Apr 22 20:05:53 GMT 2006


yup, LoadLibrary/GetProcAddress seems the right way to go. Will try.

Thanks!

Marcel

Guy Harris wrote:
> On Apr 21, 2006, at 11:21 AM, Marcel van Lieshout wrote:
> 
>> Question
>> Is there a possibility to defer the load of wpcap.dll? Either
>> explicitly ( pcap_Load() )
> 
> If it were called pcap_Load(), that'd presumably be in wpcap.dll, and
> it'd be hard to call it without first loading it. :-)
> 
>> or implicit at first library-call?
> 
> I don't know whether the Windows run-time linker supports that.
> 
> The way I know of for doing that sort of thing is to do a LoadLibrary
> () of the library and then call GetProcAddress() to get pointers to
> the functions in the library.  That's how Ethereal does it, for
> example (see capture-wpcap.c in the Ethereal source, although it uses
> GLib's calls for run-time linking rather than directly calling the
> Windows routines).
> 
> (This trick probably works on most UN*Xes, too, with the equivalent
> APIs, e.g. dlopen()/dlsym().  OS X is, I think, an exception, as
> dynamically-linked shared libraries and run-time-loaded code modules
> are different.)
> 
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users


More information about the Winpcap-users mailing list