[Winpcap-users] pcap_findalldevs Hangs when called in Windowsservice

Thomas O'Hare Tom at RedTile.Com
Sat Aug 12 12:15:33 GMT 2006


FWIW...

I will "suggest" a possible way to better isolate your problem.
FireDaemon is a service installer, but has a "lot" more options built
into it.

IOW, you may want to try using the 30 day demo of this product to try
and determine if it is really a thread problem or a Windows problem.

Like I said, FWIW, I just thought it may be of some help and I hope it is.

http://www.firedaemon.com/downloads-firedaemon-pro.php

I bought the Pro version and love it.  I can run EXE from different
machine languages and use them as a service even though they were not
intended as such.  It appears to be a very good product -- IMO.

Thanks,
~ Thomas O'Hare ~
President, RedTile, Inc. - DBA: RedTile Software
Web, Wireless, Network, Database & Systems Software
+1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/
Operations Manager; Virtual FoxPro User Group
Tom at VFUG.Org ; http://www.VFUG.Org/


Richard Bellengere wrote:
> Hi Thomas
> 
> Thanks for your response.
> 
> My problem comes in that the program is being run as a Win32 Service.
> The OS loads the services into threads that are created and controlled
> by the Service Manager. The main work of my app is run within one of
> those threads.
> 
> When I run my app standalone I have exactly what you say - findalldevs
> is run in the main thread. But when run as a service my program's main
> thread is actually a subthread of the service manager and findalldevs
> fails.
> 
> The apps is required to autodetect the first network card and start
> listening on it. Perhaps I can pre-configure its name into a registry
> key or something and bypass findalldevs.  Will try that next week.
> 
> Regards
> RichardB
> 
> -----Original Message-----
> From: winpcap-users-bounces at winpcap.org
> [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Thomas O'Hare
> Sent: 11 August 2006 16:16
> To: winpcap-users at winpcap.org
> Subject: Re: [Winpcap-users] pcap_findalldevs Hangs when called in
> Windowsservice
> 
> Richard
> 
> OK, excuse the blatant ignorance of my question, but I am just curious.
> 
> Since pcap_findalldevs_ex(), IMO, is very seldom called, why are you
> using sub-threads?
> 
> IOW, one call and you have your list and then can use that list for a
> determinant period of time.  If changes occur you can just call the
> function again manually.
> 
> If you can enlighten me I would appreciate it.
> 
> Thanks,
> ~ Thomas O'Hare ~
> President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network,
> Database & Systems Software
> +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/
> Operations Manager; Virtual FoxPro User Group Tom at VFUG.Org ;
> http://www.VFUG.Org/
> 
> 
> Steighton_Haley at mcafee.com wrote:
>> Yes, confirmed, I have seen the same bug in my application as well.
>>  
>> And as you note, it always happens when pcap_findalldevs_ex is called 
>> from a sub-thread, rather than the main thread of my application.
>>
>>
>> ________________________________
>>
>> 	From: winpcap-users-bounces at winpcap.org 
>> [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Richard 
>> Bellengere
>> 	Sent: Tuesday, August 08, 2006 5:44 AM
>> 	To: winpcap-users at winpcap.org
>> 	Subject: [Winpcap-users] pcap_findalldevs Hangs when called in 
>> Windows service
>> 	
>> 	
>> 	Hi.
>> 	 
>> 	I'm getting exactly the same thing.  Did you ever get a solution
> to 
>> this problem?
>> 	 
>> 	It seems to have something to do with findalldevs being called
> from a 
>> new thread and not the process's main thread.
>> 	 
>> 	Thanks
>> 	RichardB
>>
>>
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>> _______________________________________________
>> Winpcap-users mailing list
>> Winpcap-users at winpcap.org
>> https://www.winpcap.org/mailman/listinfo/winpcap-users
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
> 
> 
> 
> 
> _______________________________________________
> 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