Hi,
I'm trying to use pcap_getevent, but the handle it returns doesn't
appear to be valid, what i'm trying to do is to wait on both the pcap
handle, and a handle of my own, so that i can stop the capture process
from the GUI. I have something like
pcap_t *fp;
// set up fp and set a filter here
....
// loop and check for our stop event
HANDLE events[2] ;
events[0] = m_stopEvent ; // my event
events[1] = pcap_getevent(fp) ;
DWORD state = WaitForMultipleObjectsEx ( 2, events, FALSE, INFINITE, TRUE ) ;
while ( state != WAIT_OBJECT_0 )
{
pcap_dispatch(fp, -1, dispatcher_handler, (u_char *)&hndlr);
state = WaitForMultipleObjectsEx ( 2, events, FALSE, INFINITE, TRUE ) ;
if ( state == -1 )
ATLTRACE(_T("WFMOE error=%d\n"), GetLastError() ) ;
else
ATLTRACE(_T("state = %x\n"), state ) ;
}
pcap_close(fp) ;
....
WaitForMultipleObjectsEx always returns -1 [error] and GetLastError
returns 6 "The handle is invalid.". If i change the code so its only
waiting on my handle, then i don't get the error, so it appears to be
the handle returned by pcap_getevent that's the problem.
This is with WinPCap 2.2 on Windows 2000 server with SP2.
Thanks
Simon
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe