Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp	(revision 38310)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/Helper.cpp	(revision 38313)
@@ -99,4 +99,9 @@
 bool handleCurrentSession(void)
 {
+    /* Load global configuration from registry. */
+    DWORD dwRet = loadConfiguration();
+    if (ERROR_SUCCESS != dwRet)
+        LogRel(("VBoxGINA::handleCurrentSession: Error loading global configuration, error=%ld\n", dwRet));
+
     bool fHandle = false;
     if (isRemoteSession())
@@ -107,4 +112,8 @@
     else /* No remote session. */
         fHandle = true;
+
+    if (!fHandle)
+        LogRel(("VBoxGINA::handleCurrentSession: Handling of remote desktop sessions is disabled.\n"));
+
     return fHandle;
 }
Index: trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp	(revision 38310)
+++ trunk/src/VBox/Additions/WINNT/VBoxGINA/VBoxGINA.cpp	(revision 38313)
@@ -109,5 +109,5 @@
 #ifdef DEBUG_andy
     /* Enable full log output. */
-    RTLogGroupSettings(RTLogRelDefaultInstance(), "+default.e.l.f.l2.l3");
+    RTLogGroupSettings(0, "+autologon.e.l.f.l2.l3");
 #endif
 
@@ -231,6 +231,9 @@
     wlxVersion = dwWinlogonVersion;
 
-    /* forward call */
-    return GWlxNegotiate(dwWinlogonVersion, pdwDllVersion);
+    /* Acknowledge interface version. */
+    if (pdwDllVersion)
+        *pdwDllVersion = dwWinlogonVersion;
+
+    return TRUE; /* We're ready to rumble! */
 }
 
@@ -241,24 +244,14 @@
     Log(("VBoxGINA::WlxInitialize\n"));
 
-    /* store Winlogon function table */
+    /* Store Winlogon function table */
     pWlxFuncs = (PWLX_DISPATCH_VERSION_1_1)pWinlogonFunctions;
 
-    /* store handle to Winlogon service*/
+    /* Store handle to Winlogon service*/
     hGinaWlx = hWlx;
 
-    /* Load global configuration from registry. */
-    DWORD dwRet = loadConfiguration();
-    if (ERROR_SUCCESS != dwRet)
-        LogRel(("VBoxGINA: Error loading global configuration, error=%ld\n", dwRet));
-
-    /* If we have a remote session (that is, a connection via remote desktop /
-     * terminal services) deny it if not specified explicitly. */
-    if (!handleCurrentSession())
-        LogRel(("VBoxGINA: Handling of remote desktop sessions is disabled.\n"));
-
-    /* hook the dialogs */
+    /* Hook the dialogs */
     hookDialogBoxes(pWlxFuncs, wlxVersion);
 
-    /* forward call */
+    /* Forward call */
     return GWlxInitialize(lpWinsta, hWlx, pvReserved, pWinlogonFunctions, pWlxContext);
 }
@@ -269,9 +262,9 @@
     Log(("VBoxGINA::WlxDisplaySASNotice\n"));
 
-    /* check if there are credentials for us, if so simulate C-A-D */
+    /* Check if there are credentials for us, if so simulate C-A-D */
     if (credentialsAvailable())
     {
         Log(("VBoxGINA::WlxDisplaySASNotice: simulating C-A-D\n"));
-        /* automatic C-A-D */
+        /* Wutomatic C-A-D */
         pWlxFuncs->WlxSasNotify(hGinaWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
     }
@@ -293,5 +286,5 @@
     Log(("VBoxGINA::WlxLoggedOutSAS\n"));
 
-    /* when performing a direct logon without C-A-D, our poller might not be running */
+    /* When performing a direct logon without C-A-D, our poller might not be running */
     if (!credentialsAvailable())
         credentialsPollerCreate();
@@ -304,5 +297,5 @@
     {
         //
-        // copy pMprNotifyInfo and pLogonSid for later use
+        // Copy pMprNotifyInfo and pLogonSid for later use
         //
 
@@ -346,9 +339,9 @@
     Log(("VBoxGINA::WlxDisplayLockedNotice\n"));
 
-    /* check if there are credentials for us, if so simulate C-A-D */
+    /* Check if there are credentials for us, if so simulate C-A-D */
     if (credentialsAvailable())
     {
         Log(("VBoxGINA::WlxDisplayLockedNotice: simulating C-A-D\n"));
-        /* automatic C-A-D */
+        /* Automatic C-A-D */
         pWlxFuncs->WlxSasNotify(hGinaWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
     }
@@ -375,5 +368,5 @@
     Log(("VBoxGINA::WlxWkstaLockedSAS\n"));
 
-    /* when performing a direct logon without C-A-D, our poller might not be running */
+    /* When performing a direct logon without C-A-D, our poller might not be running */
     if (!credentialsAvailable())
         credentialsPollerCreate();
@@ -385,10 +378,7 @@
 BOOL WINAPI WlxIsLogoffOk(PVOID pWlxContext)
 {
-    BOOL bSuccess;
-
     Log(("VBoxGINA::WlxIsLogoffOk\n"));
 
-    bSuccess = GWlxIsLogoffOk(pWlxContext);
-
+    BOOL bSuccess = GWlxIsLogoffOk(pWlxContext);
     if (bSuccess)
     {
@@ -432,5 +422,5 @@
     if (GWlxScreenSaverNotify)
         return GWlxScreenSaverNotify(pWlxContext, pSecure);
-    /* return something intelligent */
+    /* Return something intelligent */
     *pSecure = TRUE;
     return TRUE;
@@ -442,5 +432,5 @@
 {
     Log(("VBoxGINA::WlxStartApplication: pWlxCtx=%p, pszDesktopName=%ls, pEnvironment=%p, pszCmdLine=%ls\n",
-        pWlxContext, pszDesktopName, pEnvironment, pszCmdLine));
+         pWlxContext, pszDesktopName, pEnvironment, pszCmdLine));
 
     /* Forward to MSGINA if present. */
@@ -507,5 +497,5 @@
     Log(("VBoxGINA::WlxGetConsoleSwitchCredentials\n"));
 
-    /* forward call to MSGINA if present */
+    /* Forward call to MSGINA if present */
     if (GWlxGetConsoleSwitchCredentials)
         return GWlxGetConsoleSwitchCredentials(pWlxContext,pCredInfo);
