Load WinPcap before we get the run-time information string.
authorGuy Harris <guy@alum.mit.edu>
Tue, 24 Jun 2014 20:04:22 +0000 (13:04 -0700)
committerGuy Harris <guy@alum.mit.edu>
Tue, 24 Jun 2014 20:05:28 +0000 (20:05 +0000)
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>
tshark.c

index 736065296128efcfc42041b8ea23c1d43569f905..8b1d522713fe991d50aa8f9529390a397242063e 100644 (file)
--- 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. */