[Winpcap-users] pcap_freealldevs() causing program crash.

Terry Braun tab at talking.com
Wed Nov 16 20:36:37 GMT 2005


I think the idea is to
a) copy the string for(i = 0 ; etc)
b) call freealldevs()
If you try to access the pointer d->name after the call to freealldevs() 
bad things *will* happen. Not sure if that is what you are doing

Have a very nice day.
\t

Eric Hansen wrote:
> Yup.  What I do, is store the info like so:
>
> cDevice[iCount] = d->name;
>
> Then, when I goto list the info, I do this:
>
> for(i = 0; i < iCount; i++){
> m_devices.AddString(cDevice[i]);
> }
>
> (m_devices is a ListBox)
>
> On 11/16/05, *Gianluca Varenni* <gianluca.varenni at cacetech.com 
> <mailto:gianluca.varenni at cacetech.com>> wrote:
>
>     Maybe it's an obvious question: are you actually *copying" the
>     strings in pcap_if_t* (e.g. pcap_if_t::name and
>     pcap_if_t::description)?
>      
>     Have a nice day
>     GV
>      
>      
>      
>      
>
>         ----- Original Message -----
>         *From:* Eric Hansen <mailto:nightskywriter at gmail.com>
>         *To:* winpcap-users at winpcap.org
>         <mailto:winpcap-users at winpcap.org>
>         *Sent:* Wednesday, November 16, 2005 11:12 AM
>         *Subject:* Re: [Winpcap-users] pcap_freealldevs() causing
>         program crash.
>
>         No, what I have so far is just all the information stored in
>         arrays, and I display that info. after calling freealldevs();
>
>         MqX: Thanks, but it's still causing me trouble (I really
>         appreciate it though).
>
>         On 11/16/05, *Guy Harris* <guy at alum.mit.edu
>         <mailto:guy at alum.mit.edu+>> wrote:
>
>             Eric Hansen wrote:
>             > Well, I got my program to not crash (I put the
>             freealldevs() at the very
>             > end of my init function).  But, now, the device names are
>             "encrypted"
>             > (they show up in weird characters now, unlike before when
>             they showed up
>             > like they should).
>
>             You're not referring to the devices after the
>             pcap_freealldevs() call,
>             right?
>             _______________________________________________
>             Winpcap-users mailing list
>             Winpcap-users at winpcap.org <mailto:Winpcap-users at winpcap.org>
>             https://www.winpcap.org/mailman/listinfo/winpcap-users
>
>
>
>
>         -- 
>         http://tenshi.honeyblade.net (my poetry)
>
>         "You wanted this ending to happen...ROMANTISUTO!"
>
>         _______________________________________________
>         Winpcap-users mailing list
>         Winpcap-users at winpcap.org <mailto:Winpcap-users at winpcap.org>
>         https://www.winpcap.org/mailman/listinfo/winpcap-users
>
>
>     _______________________________________________
>     Winpcap-users mailing list
>     Winpcap-users at winpcap.org <mailto:Winpcap-users at winpcap.org>
>     https://www.winpcap.org/mailman/listinfo/winpcap-users
>
>
>
>
>
> -- 
> http://tenshi.honeyblade.net (my poetry)
>
> "You wanted this ending to happen...ROMANTISUTO!"
> ------------------------------------------------------------------------
>
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20051116/7eb36aff/attachment.htm


More information about the Winpcap-users mailing list