<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><BR>Hi jimmy<BR>
&nbsp;<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>
&nbsp;<BR>
Program is very stable now, but I have found out that its best if you place critical sections around pcap calls like<BR>
&nbsp;<BR>
pcap_open_live and pcap_findalldevs in particular.<BR>
&nbsp;<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>
&nbsp;<BR>
I did the same with pcap_lookupnet, pcap_compile and pcap_setfilter.<BR>
&nbsp;<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>
&nbsp;<BR>
<BR>&nbsp;<BR>
<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>
&nbsp;<BR>
but on windows 2000 server, it shows critical fault and then my machine&nbsp;had been&nbsp;rebooted.<BR>
i wonder&nbsp;whether my code is stupid or opening more than one adapter is impossible.<BR>
&nbsp;<BR>
is there anybody who has same experience ??<BR>
&nbsp;<BR>
&nbsp;<BR>
best regrads, jimmy.<BR>
&nbsp;<BR>
&nbsp;<BR></DIV><PRE></PRE>
&nbsp;<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></body>
</html>