aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r--capture-wpcap.c13
1 files changed, 13 insertions, 0 deletions
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