a snapshot of my code is here :


///////Inside the OnInitDialog() Function....there is no matter with this part of code!(the adapter is opened somehow
///// m_capture_session_handle, m_network_adapter, m_errbuf are member variables


if (pcap_findalldevs_ex(NULL, NULL , 0 , NULL, &m_network_adapter, m_errbuf) == -1)
{
AfxMessageBox(_T("Error in pcap_findalldevs_ex ()"));
return FALSE;
}



if( (m_capture_session_handle = pcap_open ( m_network_adapter->name /*pcap_if_t struct*/,
65536 ,
1 ,
1000,
NULL,
m_errbuf )) == NULL )
{
AfxMessageBox(_T("Error!"));
pcap_freealldevs(m_network_adapter) ;
return;
}


////Inside a message handler function in the same class as OnInitDialog()....the part which causes error!
//// m_pkt_header, m_pkt_data are member variables


if(pcap_next_ex ( m_capture_session_handle   /*    pcap_t *     */,
                 m_pkt_header/*   struct pcap_pkthdr **      */,
                 m_pkt_data /*     u_char **       */) == -1)
{
        AfxMessageBox(_T("Error!"));
}

_________________________________________________________________




================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/[EMAIL PROTECTED]/

To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to