<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Well, there's no relationship between pcap_open and
pcap_findalldevs (apart from the fact that you may have used the adapter names
returned by pcap_findalldevs to open an adapter with pcap_open).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>pcap_freealldevs should always be called (once) after a
successful call to pcap_findalldevs. </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><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=nightskywriter@gmail.com href="mailto:nightskywriter@gmail.com">Eric
Hansen</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> Wednesday, November 16, 2005 9:01
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Winpcap-users]
pcap_freealldevs() causing program crash.</DIV>
<DIV><BR></DIV>Yup :) I've debugged the pointer to, to make sure there
wasn't something I wasn't catching otherwise. I think I found my problem
though. What if I do not call pcap_open()? For example, if I don't
call that, should I still be calling freealldevs()?<BR><BR>
<DIV><SPAN class=gmail_quote>On 11/16/05, <B class=gmail_sendername>Gianluca
Varenni</B> <<A
href="mailto:gianluca.varenni@cacetech.com ">gianluca.varenni@cacetech.com
</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV><FONT size=2>Hi.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Did you also check that you aren't calling
CDevice::Cleanup multiple times on the same "devs" pointer (thus trying to
free the adapters list multiple times)?</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>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV><SPAN class=e id=q_10799f09b5527f6a_1>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">-----
Original Message ----- </DIV>
<DIV
style="BACKGROUND: rgb(228,228,228) 0% 50%; FONT: 10pt arial; font-size-adjust: none; font-stretch: normal; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial"><B>From:</B>
<A title=nightskywriter@gmail.com
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:nightskywriter@gmail.com" target=_blank>Eric Hansen</A>
</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B>
<A title=winpcap-users@winpcap.org
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:winpcap-users@winpcap.org" target=_blank>WinPCap Mailing
List</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B>
Sunday, November 13, 2005 4:04 PM</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Subject:</B>
[Winpcap-users] pcap_freealldevs() causing program crash.</DIV>
<DIV><BR></DIV>Does anyone know why, whenever I put in
"pcap_freealldevs(devs);" into my cleanup code (that frees all the memory,
etc...that my program uses), it always crashes?<BR><BR>devs
declaration:<BR>pcap_if_t *devs, *d; // Device list<BR><BR>My cleanup
code:<BR>void CDevice::Cleanup(){<BR><BR> // Free the
device list<BR> pcap_freealldevs(devs);<BR>}<BR><BR>and
how I'm using devs:<BR>void CDevice::Devices(){<BR>
if(pcap_findalldevs(&devs, error) == -1){<BR>
AfxMessageBox(error);<BR> }
else{<BR> for(iCount = 0, d = devs; d
!= NULL; d = d->next, iCount++){<BR>
if(d->description){<BR>
cDescription[iCount] =
d->description;<BR>
}<BR><BR>
cDevice[iCount] = d->name;<BR>
}<BR>
}<BR>}<BR><BR>I've been racking my brain for over an
hour trying to figure out what I'm doing.<BR><BR>(Note: I call Cleanup()
in the WM_DESTROY Windows message)<BR></SPAN></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Winpcap-users@winpcap.org"
target=_blank>Winpcap-users@winpcap.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR>
<P></P></BLOCKQUOTE><BR>_______________________________________________<BR>Winpcap-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR><A
href="http://tenshi.honeyblade.net">http://tenshi.honeyblade.net</A> (my
poetry)<BR><BR>"You wanted this ending to happen...ROMANTISUTO!"
<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>