<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2>Hi.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2>It seems to be either an XP thing or particular to my
machine. I got it running on a Server2000 machine - First
Time!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2>I will try some other machines here in the office if I can
get my hands on them.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2>Regards</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296042009-14082006><FONT face=Arial
color=#0000ff size=2>RichardB</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> winpcap-users-bounces@winpcap.org
[mailto:winpcap-users-bounces@winpcap.org] <B>On Behalf Of </B>Gianluca
Varenni<BR><B>Sent:</B> 11 August 2006 18:00<BR><B>To:</B>
winpcap-users@winpcap.org<BR><B>Subject:</B> Re: [Winpcap-users]
pcap_findalldevs Hangs when calledinWindowsservice<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=RichardB@thoroughtec.com
href="mailto:RichardB@thoroughtec.com">Richard Bellengere</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, August 11, 2006 5:36
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Winpcap-users]
pcap_findalldevs Hangs when calledinWindowsservice</DIV>
<DIV><BR></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>Hi.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>Checked Visual Studio 2005 Express and WinPCap version
4.0.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006></SPAN><SPAN
class=156571112-11082006><FONT face=Arial color=#0000ff size=2>Checked Visual
Studio 2003 C++ and WinPCap version 4.0.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006></SPAN><SPAN
class=156571112-11082006><FONT face=Arial color=#0000ff size=2>Checked program
compiled as Multibyte Characters and Unicode Characters.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2>This doesn't influence WinPcap.</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>Checked program compiled linked to runtime libraries in
multithreaded dll and static inclusion of multithreaded runtime
libraries.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>I tried compiling the same code in to a windowed app
(instead of console app) and running that as a service.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>All result in the same problem. pcap_findalldevs
hangs.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>The documetation makes reference to pcap_findalldevs_ex,
but I have not been able to find it in headers and compile, Am I missing
something?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2>If you want to use pcap_findalldevs_ex, just include pcap.h (do *NOT*
include any other header), and have both WPCAP and HAVE_REMOTE defined as
preprocessor directives. In any case pcap_findalldevs_ex is a wrapper against
pcap_findalldevs, which in turn calls PacketGetAdapterNames, which is almost
certainly the API that hangs. So it does not help.</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><SPAN class=156571112-11082006></SPAN><SPAN
class=156571112-11082006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>Is it time to start loading the debug version of the
packet.dll to get more information?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2>That would be very helpful. Please use WinPcap 4.0alpha1, as this version
produces a much more verbose trace.</FONT></SPAN></DIV>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2>Have a nice day</FONT></SPAN></DIV>
<DIV align=left><SPAN class=156571112-11082006><FONT face=Arial color=#0000ff
size=2>GV</FONT></SPAN></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>Regards</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156571112-11082006><FONT face=Arial
color=#0000ff size=2>RichardB</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> winpcap-users-bounces@winpcap.org
[mailto:winpcap-users-bounces@winpcap.org] <B>On Behalf Of </B>Gianluca
Varenni<BR><B>Sent:</B> 10 August 2006 18:15<BR><B>To:</B>
winpcap-users@winpcap.org<BR><B>Subject:</B> Re: [Winpcap-users]
pcap_findalldevs Hangs when calledinWindowsservice<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2>Richard,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I'll try to create a small test application to reproduce the
problem. One thing came to my mind: have you changed the compilation
properties of your application so have it thread safe?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Under VC2003, it's in the project properties, under C/C++
-> Code generation -> Runtime Library. Be sure to set it to set it to
multithreaded (or multithreaded DLL, depending on the flavor of CRT that you
want to use).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=RichardB@thoroughtec.com
href="mailto:RichardB@thoroughtec.com">Richard Bellengere</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, August 10, 2006 1:06
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Winpcap-users]
pcap_findalldevs Hangs when called inWindowsservice</DIV>
<DIV><BR></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>Hi</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>Sorry - my sample app depends on way too much for me to
quickly zip it up and post it.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>I'm using 3.1. I will try 4.0 and let you know
what happens.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>I'm using Visual C++ 2005 Express. I will try Visual
Studio 2003 for size too.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>Some more information that may be of interest.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>My service is compiled as a console application.
When running it (in debug mode) as a console app and not a service,
pcap_findalldevs is successful only if run from the main thread. pcap_loop
can be run from the new thread no problem. When I do the same thing in
a windowed application I can call pcap_findalldevs from the new thread
without issue. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>It really smacks of a thread permissions issue. I've
tried making sure the apps and services are running as admin (because of npf
and nm), but that does not seem to help. Right now I'm trying to find out
what the difference is between a console thread and a Window
thread.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006></SPAN><SPAN
class=843434807-10082006></SPAN><SPAN class=843434807-10082006><FONT
face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>Regards</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=843434807-10082006><FONT face=Arial
color=#0000ff size=2>RichardB</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> winpcap-users-bounces@winpcap.org
[mailto:winpcap-users-bounces@winpcap.org] <B>On Behalf Of </B>Gianluca
Varenni<BR><B>Sent:</B> 09 August 2006 19:15<BR><B>To:</B>
winpcap-users@winpcap.org<BR><B>Subject:</B> Re: [Winpcap-users]
pcap_findalldevs Hangs when called in Windowsservice<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT size=2>Richard,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>can you please provide a sample app showing the
problem?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Which version of WinPcap are you using? WinPcap 3.1 has a
known bug that affects services based on WinPcap, bug that has been fixed in
the newer versions of WinPcap like 4.0alpha1.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=RichardB@thoroughtec.com
href="mailto:RichardB@thoroughtec.com">Richard Bellengere</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, August 08, 2006 5:44
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users]
pcap_findalldevs Hangs when called in Windows service</DIV>
<DIV><BR></DIV>
<DIV>
<DIV></DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2>Hi.</FONT></SPAN></DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial size=2>I'm getting
exactly the same thing. Did you ever get a solution to this
problem?</FONT></SPAN></DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial size=2>It seems to
have something to do with findalldevs being called from a new thread and
not the process's main thread.</FONT></SPAN></DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=296015106-08082006><FONT face=Arial
size=2>RichardB</FONT></SPAN></DIV></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing list<BR><A
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR></BLOCKQUOTE>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>