diff options
author | Gerald Combs <gerald@wireshark.org> | 2006-10-19 22:43:38 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2006-10-19 22:43:38 +0000 |
commit | 99d5c5e440d958d3ee403965b32b2e98a288acb6 (patch) | |
tree | 524aa5c409370eb73d2e88cd9b66fa347696e677 /airpcap_loader.c | |
parent | ed69c761c829e25f0fd79d00d6d3879619e30d01 (diff) |
Rename get_epan_and_portaudio_version_info() to get_gui_compiled_info()
and add version info for AirPcap. Add a corresponding
get_gui_runtime_info(). Fix up whitespace.
svn path=/trunk/; revision=19620
Diffstat (limited to 'airpcap_loader.c')
-rw-r--r-- | airpcap_loader.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/airpcap_loader.c b/airpcap_loader.c index 93395382ef..80befdb047 100644 --- a/airpcap_loader.c +++ b/airpcap_loader.c @@ -53,7 +53,7 @@ * We load dinamically the dag library in order link it only when * it's present on the system */ -static HMODULE AirpcapLib; +static HMODULE AirpcapLib = NULL; static AirpcapGetLastErrorHandler g_PAirpcapGetLastError; static AirpcapGetDeviceListHandler g_PAirpcapGetDeviceList; @@ -82,6 +82,7 @@ static AirpcapSetDeviceKeysHandler g_PAirpcapSetDeviceKeys; static AirpcapGetDecryptionStateHandler g_PAirpcapGetDecryptionState; static AirpcapSetDecryptionStateHandler g_PAirpcapSetDecryptionState; static AirpcapStoreCurConfigAsAdapterDefaultHandler g_PAirpcapStoreCurConfigAsAdapterDefault; +static AirpcapGetVersionHandler g_PAirpcapGetVersion; /* Airpcap interface list */ GList *airpcap_if_list = NULL; @@ -1674,8 +1675,37 @@ BOOL load_airpcap(void) if((g_PAirpcapGetDecryptionState = (AirpcapGetDecryptionStateHandler) GetProcAddress(AirpcapLib, "AirpcapGetDecryptionState")) == NULL) return FALSE; if((g_PAirpcapSetDecryptionState = (AirpcapSetDecryptionStateHandler) GetProcAddress(AirpcapLib, "AirpcapSetDecryptionState")) == NULL) return FALSE; if((g_PAirpcapStoreCurConfigAsAdapterDefault = (AirpcapStoreCurConfigAsAdapterDefaultHandler) GetProcAddress(AirpcapLib, "AirpcapStoreCurConfigAsAdapterDefault")) == NULL) return FALSE; + if((g_PAirpcapGetVersion = (AirpcapGetVersionHandler) GetProcAddress(AirpcapLib, "AirpcapGetVersion")) == NULL) return FALSE; return TRUE; } } +/* + * Append the version of AirPcap with which we were compiled to a GString. + */ +void +get_compiled_airpcap_version(GString *str) +{ + g_string_append(str, "with AirPcap"); +} + +/* + * Append the version of AirPcap with which we we're running to a GString. + */ +void +get_runtime_airpcap_version(GString *str) +{ + guint vmaj, vmin, vrev, build; + + /* See if the DLL has been loaded successfully. Bail if it hasn't */ + if (AirpcapLib == NULL || g_PAirpcapGetVersion == NULL) { + g_string_append(str, "without AirPcap"); + return; + } + + g_PAirpcapGetVersion(&vmaj, &vmin, &vrev, &build); + g_string_sprintfa(str, "with AirPcap %d.%d.%d build %d", vmaj, vmin, + vrev, build); +} + #endif /* _WIN32 */ |