diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-08-10 05:27:50 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-08-10 05:27:50 +0000 |
commit | 47f37ee5fb7139824eaaeaecc474bbf736dc200a (patch) | |
tree | ed13401fb86d5c3930733faa6f9c5d38b5abd267 /capture-wpcap.c | |
parent | ed2befc8b7ce4c3100aa16bfa7023d464ff6aed7 (diff) |
From Graham Bloice: if we don't have "pcap_lib_version()" in WinPcap, we
might have "PacketLibraryVersion[]" in packet.dll - try using that.
svn path=/trunk/; revision=11639
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r-- | capture-wpcap.c | 13 |
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 |