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 <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-06-24 13:04:22 -07:00
parent b4d4218a18
commit 5a3632ef40
1 changed files with 11 additions and 14 deletions

View File

@ -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. */