Roman Pišl : wpcap: Translate device identifier in pcap_create.
Alexandre Julliard
julliard at winehq.org
Mon Jul 4 16:43:32 CDT 2022
Module: wine
Branch: master
Commit: be94570d441c68cc1fd13a11b363fe25ce12f34b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=be94570d441c68cc1fd13a11b363fe25ce12f34b
Author: Roman Pišl <rpisl at seznam.cz>
Date: Sat Jul 2 13:18:25 2022 +0200
wpcap: Translate device identifier in pcap_create.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53104
Signed-off-by: Roman Pišl <rpisl at seznam.cz>
Signed-off-by: André Zwing <nerv at dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wpcap/wpcap.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c
index b140deeb3d2..a295819f7fe 100644
--- a/dlls/wpcap/wpcap.c
+++ b/dlls/wpcap/wpcap.c
@@ -68,15 +68,6 @@ int CDECL pcap_compile( struct pcap *pcap, void *program, const char *buf, int o
return PCAP_CALL( compile, ¶ms );
}
-struct pcap * CDECL pcap_create( const char *src, char *errbuf )
-{
- struct pcap *ret;
- struct create_params params = { src, errbuf, &ret };
- TRACE( "%s, %p\n", src, errbuf );
- PCAP_CALL( create, ¶ms );
- return ret;
-}
-
int CDECL pcap_datalink( struct pcap *pcap )
{
TRACE( "%p\n", pcap );
@@ -579,6 +570,26 @@ static char *map_win32_device_name( const char *dev )
return ret;
}
+struct pcap * CDECL pcap_create( const char *source, char *errbuf )
+{
+ char *unix_dev;
+ struct pcap *ret;
+ TRACE( "%s, %p\n", source, errbuf );
+
+ if (!(unix_dev = map_win32_device_name( source )))
+ {
+ if (errbuf) sprintf( errbuf, "Unable to open the adapter." );
+ return NULL;
+ }
+ else
+ {
+ struct create_params params = { unix_dev, errbuf, &ret };
+ PCAP_CALL( create, ¶ms );
+ }
+ free( unix_dev );
+ return ret;
+}
+
static struct pcap *open_live( const char *source, int snaplen, int promisc, int timeout, char *errbuf )
{
char *unix_dev;
More information about the wine-cvs
mailing list