<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=ks_c_5601-1987">
<STYLE>P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY {
        FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
</STYLE>
<META content="MSHTML 6.00.2900.2995" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New"></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=vga_planets@hotmail.com
href="mailto:vga_planets@hotmail.com">Guybrush .</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, December 14, 2006 7:23
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Winpcap-users] opening more
than one adapters..</DIV>
<DIV><BR></DIV>
<DIV><BR>Hi jimmy<BR> <BR>I've had some experience with winpcap and
threading. Both opening several adapters at once and even trying opening more
pcap handles to the same adapter.<BR> <BR>Program is very stable now, but
I have found out that its best if you place critical sections around pcap
calls like<BR> <BR>pcap_open_live and pcap_findalldevs in
particular.<BR> <BR>Even if you are opening 2 different adapters, calling
pcap_open_live from 2 threads may cause a problem I cannot explain, I havent
tried to debug it any further than to place critical sections around those
calls so that there can be only thread inside these functions at a
time.<BR></DIV></BLOCKQUOTE>
<DIV><FONT face="Courier New">Have you tried using WinPcap 4.0 beta 2/3? If for
any reason WinPcap crashes while calling pcap_open_live or pcap_findalldevs from
multiple threads, it's a bug. Using critical sections surrounding those calls is
just a workaround...</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV> <BR>I did the same with pcap_lookupnet, pcap_compile and
pcap_setfilter.</DIV>
<DIV><FONT face="Courier New"></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT face="Courier New">The only two functions that are not
thread safe are pcap_compile and pcap_lookupdev. For the former one,
the only solution at the moment is using a critical section surrounding
it. For the latter, it should be considered obsolete and replaced by
pcap_findalldevs.</FONT></DIV><FONT face="Courier New"></FONT>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Have a nice day</FONT></DIV>
<DIV><FONT face="Courier New">GV</FONT><BR></DIV>
<DIV> </DIV>
<DIV> <BR>In my program however I use pcap_loop to fetch packets, which
works without critical sections.<BR><BR>I've used this with winpcap
3.1.<BR> <BR><BR> <BR></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
<HR id=EC_stopSpelling>
From: jimmy_2000@naver.com<BR>Date: Thu, 14 Dec 2006 20:34:16 +0900<BR>To:
winpcap-users@winpcap.org<BR>Subject: [Winpcap-users] opening more than one
adapters..<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass P
{margin-bottom:2px;}
</STYLE>
<DIV
style="FONT-SIZE: 10pt; BACKGROUND: none transparent scroll repeat 0% 0%; FONT-FAMILY: Gulim">is
it possibe to open several adapters simutaneously in an process??(my
application has 4 threads for each adapter)<BR>i'm developing some sniffing
tools and my machine has 4 ethernet adapters.<BR>so i want to open all of
adapters.<BR>i want to capture packets from each adapter.<BR> <BR>but
on windows 2000 server, it shows critical fault and then my machine had
been rebooted.<BR>i wonder whether my code is stupid or opening
more than one adapter is impossible.<BR> <BR>is there anybody who has
same experience ??<BR> <BR> <BR>best regrads,
jimmy.<BR> <BR> <BR></DIV><PRE></PRE> <BR><BR><A href="mailto:jimmy_2000@naver.com"><IMG
src="http://nametag.naver.com/0224b8OaZhPLZTAX+kA+" align=absMiddle
border=0></A>
<STYLE>
.ExternalClass a
{color:#4F4F30;}
, .ExternalClass EC_a:hover
{color:#4DA500;}
.ExternalClass img
{border:none;}
</STYLE>
<TABLE height=93 cellSpacing=0 cellPadding=0 width=530 border=0>
<TBODY>
<TR>
<TD colSpan=3 height=25></TD></TR>
<TR>
<TD background=http://static.naver.com/common/dot/dot3.gif colSpan=3
height=1></TD></TR>
<TR>
<TD
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: normal; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; PADDING-TOP: 5px; FONT-FAMILY: ±¼¸²; LETTER-SPACING: -1px"
width=414 height=37><A href="http://happybean.naver.com/main/home.jsp"
target=_blank><IMG height=29
src="http://static.naver.com/mail4/happybean_two_footer.gif" width=29
align=absMiddle border=0></A><A
style="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #458e01; FONT-FAMILY: µ¸¿ò; LETTER-SPACING: -1px; TEXT-DECORATION: none"
href="http://happybean.naver.com/main/home.jsp" target=_blank>»õ·Î¿î
±âºÎ¹®ÈÀÇ ¾¾¾Ñ, ÇØÇǺó!</A></TD>
<TD width=20></TD>
<TD width=96><A href="http://www.naver.com/" target=_blank><IMG
height=23 src="http://static.naver.com/new_mail/footer/logo.gif"
width=96 align=absMiddle border=0></A></TD></TR>
<TR>
<TD colSpan=3 height=30></TD></TR></TBODY></TABLE>
<TABLE style="DISPLAY: none">
<TBODY>
<TR>
<TD><IMG
src="http://nmail.naver.com/newmailcheck/JfFjD69R16GvhAnmKAgZKqtmM6MqpzK/FoI4FxMZMqgra6KrFqKrpoKqMoUlKvIGFou/KxEQaX+GWNIoMBgR+BF0bNFg+r05bzFCbVlTb4b=.gif"
border=0></TD></TR></TBODY></TABLE></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>