From 56cb2279583f0b3c6d59538fab9caec81b2d1c6a Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 10 Aug 2004 05:27:50 +0000 Subject: From Graham Bloice: if we don't have "pcap_lib_version()" in WinPcap, we might have "PacketLibraryVersion[]" in packet.dll - try using that. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11639 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture-wpcap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'capture-wpcap.c') diff --git a/capture-wpcap.c b/capture-wpcap.c index ad9d7f28dc..e81b737cb8 100644 --- a/capture-wpcap.c +++ b/capture-wpcap.c @@ -454,10 +454,23 @@ get_runtime_pcap_version(GString *str) * not and, if we have it and we have "pcap_lib_version()", * what version we have. */ + GModule *handle; /* handle returned by dlopen */ + gchar *packetVer = NULL; + if (has_wpcap) { + /* An alternative method of obtaining the version number */ + if ((handle = g_module_open("Packet.dll", 0)) != NULL) { + if (g_module_symbol(handle, "PacketLibraryVersion", + (gpointer*)&packetVer) == FALSE) + packetVer = NULL; + g_module_close(handle); + } + g_string_sprintfa(str, "with "); if (p_pcap_lib_version != NULL) g_string_sprintfa(str, p_pcap_lib_version()); + else if (packetVer != NULL) + g_string_sprintfa(str, "WinPcap (%s)", packetVer); else g_string_append(str, "WinPcap (version unknown)"); } else -- cgit v1.2.3