aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-12-16 19:52:59 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2010-12-16 19:52:59 +0000
commitbf24d478e9e70a739126e6e2ab1703335398253f (patch)
treec26132d757942219e96ca508198000a2968bb27a /util.c
parentcf63b82ca580aba06e7cb2abb2b9fdd6ee370f3d (diff)
Simplify our Remote Desktop session detection.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35206 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/util.c b/util.c
index 500330a8fc..444cf96141 100644
--- a/util.c
+++ b/util.c
@@ -37,6 +37,10 @@
#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>
@@ -326,21 +330,10 @@ 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;
- }
+ } 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;
}
return "";
}