<DIV>May be this is the answer for u: </DIV>
<DIV><A href="http://www.winpcap.org/pipermail/winpcap-users/2005-May/000031.html">http://www.winpcap.org/pipermail/winpcap-users/2005-May/000031.html</A><BR><BR><B><I>Ravi Sankar &lt;s_rsy@yahoo.com&gt;</I></B> wrote:
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hello All,<BR><BR>I am developing an recording application in Windows<BR>2000 using VC++ Ver 6. <BR><BR>When I try to use "pcap_findalldevs_ex" it gives<BR>access violation. Error message "Unhandled Expression<BR>in test.exe": 0x00000005:Access Violation". The code<BR>what i have written<BR><BR>pcap_if_t *alldevs = NULL;<BR>char errbuf[PCAP_ERRBUF_SIZE];<BR><BR>ZeroMemory (errbuf, PCAP_ERRBUF_SIZE);<BR><BR>/* Retrieve the device list */<BR>if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL,<BR>&amp;alldevs, errbuf) == -1)<BR>{<BR>AfxMessageBox ("Error in finding devices");<BR>return FALSE;<BR>}<BR><BR>/* Jump to the selected adapter */<BR>for(d=alldevs, i=0; i&lt; 1;d=d-&gt;next, i++); //to be<BR>modified<BR><BR>/* Open the adapter */<BR>if ( (m_pCaptureHandle= pcap_open(d-&gt;name, // name of<BR>the device<BR>65536, // portion of the packet to capture. <BR>// 65536 grants that the
 whole packet will<BR>be captured on all the MACs.<BR>PCAP_OPENFLAG_PROMISCUOUS, // promiscuous<BR>mode<BR>1000, // read timeout<BR>NULL, // remote authentication<BR>errbuf // error buffer<BR>) ) == NULL)<BR>{<BR>l_strTemp.Format ("Unable to open the adapter : %s",<BR>d-&gt;name);<BR>AfxMessageBox (l_strTemp);<BR>/* Free the device list */<BR>pcap_freealldevs(alldevs);<BR>return FALSE;<BR>}<BR><BR>While debugging it executes safely until ZeroMemory<BR>but when executing pcap_findalldevs_ex it fails.<BR><BR>I tried to comment pcap_findalldevs_ex function and<BR>run the next command "pcap_open" command then also it<BR>fails at that function.<BR><BR>When running the program directly with out debugging<BR>it is working fine. Only during debugging i face this<BR>problem.<BR><BR>Is there any function to be called to initialize the<BR>pcap library? If not can any one suggest what may be<BR>problem?<BR><BR>Version of WinPCap: 3.1beta4<BR><BR>Thanks in
 advance<BR>Ravi<BR><BR><BR><BR>____________________________________________________<BR>Start your day with Yahoo! - make it your home page <BR>http://www.yahoo.com/r/hs <BR><BR>_______________________________________________<BR>Winpcap-users mailing list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></DIV><p>
                <hr size=1> <a href="http://us.rd.yahoo.com/evt=34442/*http://www.yahoo.com/r/hs">Start your day with Yahoo! - make it your home page </a>