Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp	(revision 38298)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp	(revision 38310)
@@ -17,7 +17,4 @@
 
 #include <windows.h>
-#ifndef TARGET_NT4
-# include <Wtsapi32.h>
-#endif
 #include "winwlx.h"
 #include "Helper.h"
@@ -62,89 +59,5 @@
 bool isRemoteSession(void)
 {
-    bool fIsRemote = false;
-
-#if 0
-#ifndef TARGET_NT4
-    WTS_SESSION_INFO *pSessionInfo = NULL;
-    DWORD dwSessions;
-    if (WTSEnumerateSessions(WTS_CURRENT_SERVER_HANDLE,
-                             0 /* Reserved */,
-                             1 /* Version */,
-                             &pSessionInfo,
-                             &dwSessions))
-    {
-        DWORD dwRemoteSessions = 0;
-        for (DWORD i = 0; i < dwSessions; i++)
-        {
-            switch (pSessionInfo[i].State)
-            {
-                case WTSConnected:
-                case WTSActive:
-                {
-                    LPTSTR pBuffer;
-                    DWORD cbBuffer;
-                    if (  WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE,
-                                                     pSessionInfo[i].SessionId,
-                                                     WTSClientProtocolType,
-                                                     &pBuffer, &cbBuffer)
-                        && pBuffer
-                        && cbBuffer)
-                    {
-                        USHORT uProto = (USHORT)(pBuffer);
-                        /* Only count RDP sessions -- these are the ones we're
-                         * interested in here. */
-                        if (uProto == WTS_PROTOCOL_TYPE_RDP)
-                            dwRemoteSessions++;
-                        WTSFreeMemory(pBuffer);
-#ifndef DEBUG
-                        if (dwRemoteSessions) /* Bail out as soon as possible. */
-                            break;
-#endif
-                    }
-                    break;
-                }
-
-                default:
-                    break;
-            }
-        }
-
-#ifdef DEBUG
-        Log(("VBoxGINA: %s connections detected\n",
-             dwRemoteSessions ? "RDP" : "No RDP"));
-#endif
-        if (pSessionInfo)
-            WTSFreeMemory(pSessionInfo);
-
-        if (dwSessions)
-            fIsRemote = true;
-    }
-#endif
-#else
-    LPTSTR pBuffer;
-    DWORD cbBuffer;
-    if (  WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE,
-                                     WTS_CURRENT_SESSION,
-                                     WTSClientProtocolType,
-                                     &pBuffer, &cbBuffer)
-        && pBuffer
-        && cbBuffer)
-    {
-        USHORT uProto = (USHORT)(pBuffer);
-        /* Only count RDP sessions -- these are the ones we're
-         * interested in here. */
-        fIsRemote = uProto == WTS_PROTOCOL_TYPE_RDP;
-        WTSFreeMemory(pBuffer);
-    }
-    else
-        Log(("VBoxGINA: Error %ld querying session information\n",
-             GetLastError()));
-#endif
-
-#ifdef DEBUG
-    Log(("VBoxGINA: Is remote session: %s\n",
-         fIsRemote ? "Yes" : "No"));
-#endif
-    return fIsRemote;
+    return (0 != GetSystemMetrics(SM_REMOTESESSION)) ? true : false;
 }
 
Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/Makefile.kmk	(revision 38298)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/Makefile.kmk	(revision 38310)
@@ -5,5 +5,5 @@
 
 #
-# Copyright (C) 2006-2007 Oracle Corporation
+# Copyright (C) 2006-2011 Oracle Corporation
 #
 # This file is part of VirtualBox Open Source Edition (OSE), as
@@ -21,5 +21,8 @@
 DLLS += VBoxGINA
 VBoxGINA_TEMPLATE = VBOXGUESTR3DLL
-VBoxGINA_DEFS     = UNICODE LOG_TO_BACKDOOR VBGL_VBOXGUEST VBOX_WITH_HGCM
+VBoxGINA_DEFS     = UNICODE VBGL_VBOXGUEST VBOX_WITH_HGCM
+ifdef DEBUG_andy
+ VBoxGINA_DEFS   += LOG_ENABLED
+endif
 VBoxGINA_SOURCES  = \
 	VBoxGINA.cpp \
@@ -31,8 +34,4 @@
 	$(VBOX_LIB_IPRT_GUEST_R3) \
 	$(VBOX_LIB_VBGL_R3)
-ifndef TARGET_NT4
- VBoxGINA_LIBS   += \
-	WtsApi32.lib
-endif
 
 include	$(KBUILD_PATH)/subfooter.kmk
Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.h	(revision 38298)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.h	(revision 38310)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -19,4 +19,6 @@
 
 #include <iprt/initterm.h>
+
+#define LOG_GROUP LOG_GROUP_AUTOLOGON
 #include <VBox/log.h>
 
