wpcap: Implement pcap_loop.

This commit is contained in:
André Hentschel 2014-08-15 22:48:14 +02:00 committed by Alexandre Julliard
parent 927f8bee46
commit d45f9144a1
2 changed files with 19 additions and 1 deletions

View File

@ -123,6 +123,24 @@ int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned i
return pcap_lookupnet(device, netp, maskp, errbuf);
}
int CDECL wine_pcap_loop(pcap_t *p, int cnt,
void (CALLBACK *callback)(u_char *, const struct pcap_pkthdr *, const u_char *),
unsigned char *user)
{
TRACE("(%p %i %p %p)\n", p, cnt, callback, user);
if (callback)
{
PCAP_HANDLER_CALLBACK *pcb;
pcb = HeapAlloc(GetProcessHeap(), 0, sizeof(PCAP_HANDLER_CALLBACK));
pcb->pfn_cb = callback;
pcb->user_data = user;
return pcap_loop(p, cnt, pcap_handler_callback, (unsigned char*)pcb);
}
return pcap_loop(p, cnt, NULL, user);
}
int CDECL wine_pcap_major_version(pcap_t *p)
{
TRACE("(%p)\n", p);

View File

@ -39,7 +39,7 @@
@ stub pcap_live_dump_ended
@ cdecl pcap_lookupdev(ptr) wine_pcap_lookupdev
@ cdecl pcap_lookupnet(str ptr ptr ptr) wine_pcap_lookupnet
@ stub pcap_loop
@ cdecl pcap_loop(ptr long ptr ptr) wine_pcap_loop
@ cdecl pcap_major_version(ptr) wine_pcap_major_version
@ cdecl pcap_minor_version(ptr) wine_pcap_minor_version
@ stub pcap_next