wpcap: Avoid deprecated pcap_lookupdev().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-08-06 10:05:18 +02:00
parent 0f37157bf9
commit 732d0db63b
1 changed files with 11 additions and 1 deletions

View File

@ -202,8 +202,18 @@ int CDECL wine_pcap_list_datalinks(pcap_t *p, int **dlt_buffer)
char* CDECL wine_pcap_lookupdev(char *errbuf)
{
static char *ret;
pcap_if_t *devs;
TRACE("(%p)\n", errbuf);
return pcap_lookupdev(errbuf);
if (!ret)
{
if (pcap_findalldevs( &devs, errbuf ) == -1) return NULL;
if (!devs) return NULL;
if ((ret = heap_alloc( strlen(devs->name) + 1 ))) strcpy( ret, devs->name );
pcap_freealldevs( devs );
}
return ret;
}
int CDECL wine_pcap_lookupnet(const char *device, unsigned int *netp, unsigned int *maskp,