Commit d45f9144 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

wpcap: Implement pcap_loop.

parent 927f8bee
...@@ -123,6 +123,24 @@ int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned i ...@@ -123,6 +123,24 @@ int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned i
return pcap_lookupnet(device, netp, maskp, errbuf); 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) int CDECL wine_pcap_major_version(pcap_t *p)
{ {
TRACE("(%p)\n", p); TRACE("(%p)\n", p);
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
@ stub pcap_live_dump_ended @ stub pcap_live_dump_ended
@ cdecl pcap_lookupdev(ptr) wine_pcap_lookupdev @ cdecl pcap_lookupdev(ptr) wine_pcap_lookupdev
@ cdecl pcap_lookupnet(str ptr ptr ptr) wine_pcap_lookupnet @ 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_major_version(ptr) wine_pcap_major_version
@ cdecl pcap_minor_version(ptr) wine_pcap_minor_version @ cdecl pcap_minor_version(ptr) wine_pcap_minor_version
@ stub pcap_next @ stub pcap_next
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment