[Winpcap-users] why pcap_findalldevs run about 30 seconds
工商银行
my95588 at gmail.com
Tue Dec 11 01:24:59 GMT 2007
I set DependOnService npf and nm service followed your suggestion.
It still wait about 30 seconds,
My log info followed:
2007-12-11 08:56:25 Power on my computer,Windows start,
2007-12-11 08:56:41 Windows XP Display login dialog and enter my password
to login in
2007-12-11 08:56:46 start my network authorized program......
2007-12-11 08:56:46 look up used network card......
2007-12-11 08:57:16 Use Network card:Intel(R) PRO/1000 MT Network
Connection (Microsoft's Packet Scheduler)
2007-12-11 08:57:16 send EAPOL_START packet
2007-12-11 08:57:17 receive server message
2007-12-11 08:57:18 already authorized,Through DHCP get ip address and
enter into the corparation local network.
Can I speed up npf and nm service ?
Or set to start these service after windows display login dialog as fast as
possible?
Thank you!
2007/12/10, Bryan Kadzban <bryan at kadzban.is-a-geek.net>:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
> 工商银行 wrote:
> > I found that the pcap_findalldevs function consume about 34 seconds.
> > My question is how long does the winpcap driver loaded ?
>
> The driver loads in a few milliseconds, usually.
>
> > Does it loaded earlier than the network interface loaded?
>
> If it does load before the network card does, winpcap handles the
> dynamic addition of the card. As long as your program does a
> pcap_findalldevs* after that new card is present, and you're using a
> new-enough winpcap (4.0 should be fine), that will work fine. (It also
> won't cause an extra delay.)
>
> > My program is put into the windows system service.auto started.
>
> Oh, you're writing a service. Well that's different then. I'm guessing
> that you're calling pcap_findalldevs in either ServiceMain or in your
> service's START control handler? Whenever you make your first winpcap
> driver call (and pcap_findalldevs is one of those), the DLL tries to
> start the "npf" driver. But if the service control manager is in the
> middle of starting your service, it won't go start another one. (The
> winpcap DLL also used to require the "nm" service to be running; I don't
> know if this is true anymore, but I believe it still is.)
>
> What you need to do is use service dependencies to make the service
> control manager start the "npf" and "nm" services *before* it starts
> yours. When you call the API that installs your service, there should
> be a parameter for dependencies (or you can add a REG_MULTI_SZ named
> "DependOnService" to your service's registry key, but you have to reboot
> for that to take effect). Add both "npf" and "nm" as dependencies.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHXSxKS5vET1Wea5wRA4rFAJ4t/BmfYGXG2RDQyVOz6L3zPx8ZfgCgxsL/
> UacLZ64+/wipzWv/sjA6ZB0=
> =rKwm
> -----END PGP SIGNATURE-----
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20071211/818bcdc0/attachment-0001.htm
More information about the Winpcap-users
mailing list