<div>Hi,</div>
<div> </div>
<div>So our application will open and close when we use it the first time after a reboot. But if we open it twice the 2nd time it succeeds and everything is fine. If we open ethereal and close it and then open our application everything is fine too. Is there something we are not doing to initialize winpcap?
</div>
<div> </div>
<div>Thanks</div>
<div> </div>
<div><font size="2">
<p>pcap_if_t *alldevs;</p>
<p>pcap_if_t *d;</p>
<p></p></font><font color="#0000ff" size="2">int</font><font size="2"> i=0;
<p></p></font><font color="#0000ff" size="2">char</font><font size="2"> errbuf[PCAP_ERRBUF_SIZE];
<p></p>
<p></p></font><font color="#0000ff" size="2">if</font><font size="2">(pcap_findalldevs(&alldevs, errbuf) == -1)
<p>{</p>
<p>fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);</p>
<p></p></font><font color="#0000ff" size="2">return</font><font size="2">;
<p>}</p>
<p></p>
<p></p></font><font color="#0000ff" size="2">for</font><font size="2">(d=alldevs; d; d=d->next)
<p>{ </p>
<p></p></font><font color="#0000ff" size="2">char</font><font size="2"> *deviceName = strdup(d->name);
<p>CreateThread(NULL, 0, &StartRoutine, deviceName, 0, NULL);</p>
<p>}</p>
<p>pcap_freealldevs(alldevs);</p></font></div>