----- Original Message -----
From: "Andrea Talucci" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 07, 2004 5:02 PM
Subject: Re: [WinPcap-users] Access Violation using pcap_findalldevs
> Gianluca Varenni wrote:
> > Can you provide me a small test app showing the bug?
> It's strange, it happens only if I place a break point at the line of
> the function containing the pcap_findalldevs call... I think It's just
> some dirty pointer in my code coming up in debug mode... however here
> follows the code: there is a main, some declaration, and the call to
> getInterface. Placing a break point at d=getInterface(...) and entering
> into the function while debugging, generate the access violation calling
> pcap_findalldevs(...). Not placing the break point, causes the program
> to execute correctly. The ide is VS6 with the last service pack.
>
> regards,
> Andrea
>
>
>
> int main(int argc, char **argv){
> pcap_if_t *d=0;
> struct bpf_program fcode;
> bpf_u_int32 netp=0;
> bpf_u_int32 NetMask=0;
> char filterString[256];
> int seldevice=0;
> int i=0;
>
> // Breakpoint at the following line...
> d=getInterface(&seldevice);
>
> [...]
>
> }
>
>
> pcap_if_t *getInterface(int *seldevice){
> pcap_if_t *d;
> int i=0;
>
> // Access Violation
> if (pcap_findalldevs(&alldevs, errbuf) == -1){
> fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);
> exit(1);
> }
Are you about this? I think the right code would be
> if (pcap_findalldevs(&d, errbuf) == -1){
^^^
However I need a small test app that compiles to track down the problem.
Have a nice day
GV
>
> [...]
>
> }
>
>
> ==================================================================
> This is the WinPcap users list. It is archived at
> http://www.mail-archive.com/[EMAIL PROTECTED]/
>
> To unsubscribe use
> mailto: [EMAIL PROTECTED]
> ==================================================================
>
==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe use
mailto: [EMAIL PROTECTED]
==================================================================