Do case insensitive search for lua scripts to load.
[obnox/wireshark/wip.git] / util.c
diff --git a/util.c b/util.c
index 500330a8fc04e3f2c2909b830a1dcbd81ea6b41e..a7a25578cf5206a1cc9da371b3c587c44df88a4b 100644 (file)
--- a/util.c
+++ b/util.c
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
 #include <epan/address.h>
 #include <epan/addr_resolv.h>
 #include <epan/strutil.h>
@@ -128,7 +132,7 @@ compute_timestamp_diff(gint *diffsec, gint *diffusec,
 }
 
 /* Remove any %<interface_name> from an IP address. */
-char *sanitize_filter_ip(char *hostname) {
+static char *sanitize_filter_ip(char *hostname) {
     gchar *end;
     gchar *ret;
 
@@ -326,21 +330,12 @@ const gchar *get_conn_cfilter(void) {
                        host_ip_af(phostname), phostname);
                g_free(phostname);
                return filter_str->str;
-       } else if ((env = getenv("SESSIONNAME")) != NULL) {
-               /* Apparently the KB article at
-                * http://technet2.microsoft.com/WindowsServer/en/library/6caf87bf-3d70-4801-9485-87e9ec3df0171033.mspx?mfr=true
-                * is incorrect.  There are _plenty_ of cases where CLIENTNAME
-                * and SESSIONNAME are set outside of a Terminal Terver session.
-                * It looks like Terminal Server sets SESSIONNAME to RDP-TCP#<number>
-                * for "real" sessions.
-                *
-                * XXX - There's a better way to do this described at
-                * http://www.microsoft.com/technet/archive/termsrv/maintain/featusability/tsrvapi.mspx?mfr=true
-                */
-               if (g_ascii_strncasecmp(env, "rdp", 3) == 0) {
-                       g_string_printf(filter_str, "not tcp port 3389");
-                       return filter_str->str;
-               }
+#ifdef _WIN32
+       } else if (GetSystemMetrics(SM_REMOTESESSION)) {
+               /* We have a remote session: http://msdn.microsoft.com/en-us/library/aa380798%28VS.85%29.aspx */
+               g_string_printf(filter_str, "not tcp port 3389");
+               return filter_str->str;
+#endif /* _WIN32 */
        }
        return "";
 }