From 5a3632ef4066989f3b8a8c07bd60aab6b56b4623 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 24 Jun 2014 13:04:22 -0700 Subject: [PATCH] Load WinPcap before we get the run-time information string. That way, we can include the WinPcap version in that string. Change-Id: I01fa0defce158e122d1c602fdfbc81916a9e80ef Reviewed-on: https://code.wireshark.org/review/2625 Reviewed-by: Guy Harris --- tshark.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tshark.c b/tshark.c index 7360652961..8b1d522713 100644 --- a/tshark.c +++ b/tshark.c @@ -896,18 +896,6 @@ print_current_user(void) { } } -static void -check_capture_privs(void) { -#ifdef _WIN32 - load_wpcap(); - /* Warn the user if npf.sys isn't loaded. */ - if (!npf_sys_is_running() && get_windows_major_version() >= 6) { - fprintf(stderr, "The NPF driver isn't running. You may have trouble " - "capturing or\nlisting interfaces.\n"); - } -#endif -} - static void show_version(GString *comp_info_str, GString *runtime_info_str) { @@ -1005,6 +993,17 @@ main(int argc, char *argv[]) static const char optstring[] = OPTSTRING; +#ifdef _WIN32 + /* Load wpcap if possible. Do this before collecting the run-time version information */ + load_wpcap(); + + /* Warn the user if npf.sys isn't loaded. */ + if (!npf_sys_is_running() && get_windows_major_version() >= 6) { + fprintf(stderr, "The NPF driver isn't running. You may have trouble " + "capturing or\nlisting interfaces.\n"); + } +#endif + /* Assemble the compile-time version information string */ comp_info_str = g_string_new("Compiled "); get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info); @@ -1284,8 +1283,6 @@ main(int argc, char *argv[]) g_free(dp_path); } - check_capture_privs(); - cap_file_init(&cfile); /* Print format defaults to this. */