]> source.dussan.org Git - tigervnc.git/commitdiff
Win32 vncconfig utility merged with VNC 4.1.1 code.
authorConstantin Kaplinsky <const@tightvnc.com>
Thu, 11 May 2006 05:29:14 +0000 (05:29 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Thu, 11 May 2006 05:29:14 +0000 (05:29 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/merge-with-vnc-4.1.1@547 3789f03b-4d11-0410-bbf8-ca57d06f2519

14 files changed:
vncconfig/Authentication.h
vncconfig/Connections.h
vncconfig/Desktop.h
vncconfig/Hooking.h
vncconfig/Inputs.h
vncconfig/Legacy.cxx
vncconfig/Legacy.h
vncconfig/PasswordDialog.cxx [new file with mode: 0644]
vncconfig/PasswordDialog.h [new file with mode: 0644]
vncconfig/Sharing.h
vncconfig/resource.h
vncconfig/vncconfig.cxx
vncconfig/vncconfig.dsp
vncconfig/vncconfig.rc

index 5923c2cb318e1df119e146acb94bfa425ff77932..f4b38f8c327bf8c0fc3caa1fae1b64eaa03ad1e1 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
 #ifndef WINVNCCONF_AUTHENTICATION
 #define WINVNCCONF_AUTHENTICATION
 
+#include <vncconfig/PasswordDialog.h>
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
-#include <rfb_win32/Win32Util.h>
+#include <rfb_win32/OSVersion.h>
+#include <rfb_win32/MsgBox.h>
 #include <rfb/ServerCore.h>
 #include <rfb/secTypes.h>
-#include <rfb/vncAuth.h>
-
+#include <rfb/Password.h>
 
-extern rfb::VncAuthPasswdConfigParameter vncAuthPasswd;
+static rfb::BoolParameter queryOnlyIfLoggedOn("QueryOnlyIfLoggedOn",
+  "Only prompt for a local user to accept incoming connections if there is a user logged on", false);
 
 namespace rfb {
 
   namespace win32 {
 
-    class VncPasswdDialog : public Dialog {
-    public:
-      VncPasswdDialog(const RegKey& rk) : Dialog(GetModuleHandle(0)), regKey(rk), warnPasswdInsecure(false) {}
-      bool showDialog() {
-        return Dialog::showDialog(MAKEINTRESOURCE(IDD_AUTH_VNC_PASSWD));
-      }
-      bool onOk() {
-        TCharArray password1 = getItemString(IDC_PASSWORD1);
-        TCharArray password2 = getItemString(IDC_PASSWORD2);;
-        if (_tcscmp(password1.buf, password2.buf) != 0) {
-          MsgBox(0, _T("The supplied passwords do not match"),
-                 MB_ICONEXCLAMATION | MB_OK);
-          return false;
-        }
-        if (warnPasswdInsecure &&
-          (MsgBox(0, _T("Please note that your VNC password cannot be stored securely on this system.  ")
-                     _T("Are you sure you wish to continue?"),
-                  MB_YESNO | MB_ICONWARNING) == IDNO))
-          return false;
-        char passwd[9];
-        memset(passwd, 0, sizeof(passwd));
-        strCopy(passwd, CStr(password1.buf), sizeof(passwd));
-        vncAuthObfuscatePasswd(passwd);
-        regKey.setBinary(_T("Password"), passwd, 8);
-        return true;
-      }
-      void setWarnPasswdInsecure(bool warn) {
-        warnPasswdInsecure = warn;
-      }
-    protected:
-      const RegKey& regKey;
-      bool warnPasswdInsecure;
-    };
-
     class AuthenticationPage : public PropSheetPage {
     public:
       AuthenticationPage(const RegKey& rk)
-        : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_AUTHENTICATION)),
-        passwd(rk), regKey(rk) {}
+        : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_AUTHENTICATION)), regKey(rk) {}
       void initDialog() {
-        CharArray sec_types_str;
-        sec_types_str.buf = rfb::Server::sec_types.getData();
+        CharArray sec_types_str(SSecurityFactoryStandard::sec_types.getData());
         std::list<int> sec_types = parseSecTypes(sec_types_str.buf);
 
         useNone = useVNC = false;
@@ -83,55 +49,94 @@ namespace rfb {
           else if ((*i) == secTypeVncAuth) useVNC = true;
         }
 
+        HWND security = GetDlgItem(handle, IDC_ENCRYPTION);
+        SendMessage(security, CB_ADDSTRING, 0, (LPARAM)_T("Always Off"));
+        SendMessage(security, CB_SETCURSEL, 0, 0);
+        enableItem(IDC_AUTH_NT, false); enableItem(IDC_AUTH_NT_CONF, false);
+        enableItem(IDC_ENCRYPTION, false); enableItem(IDC_AUTH_RA2_CONF, false);
+
         setItemChecked(IDC_AUTH_NONE, useNone);
         setItemChecked(IDC_AUTH_VNC, useVNC);
         setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect);
+        setItemChecked(IDC_QUERY_LOGGED_ON, queryOnlyIfLoggedOn);
+        onCommand(IDC_AUTH_NONE, 0);
       }
       bool onCommand(int id, int cmd) {
         switch (id) {
         case IDC_AUTH_VNC_PASSWD:
-          passwd.showDialog();
+          {
+            PasswordDialog passwdDlg(regKey, registryInsecure);
+            passwdDlg.showDialog(handle);
+          }
           return true;
         case IDC_AUTH_NONE:
         case IDC_AUTH_VNC:
+          enableItem(IDC_AUTH_VNC_PASSWD, isItemChecked(IDC_AUTH_VNC));
         case IDC_QUERY_CONNECT:
-          setChanged((rfb::Server::queryConnect != isItemChecked(IDC_QUERY_CONNECT)) ||
-                     (useNone != isItemChecked(IDC_AUTH_NONE)) ||
-                     (useVNC != isItemChecked(IDC_AUTH_VNC)));
+        case IDC_QUERY_LOGGED_ON:
+          setChanged((useNone != isItemChecked(IDC_AUTH_NONE)) ||
+                     (useVNC != isItemChecked(IDC_AUTH_VNC)) ||
+                     (rfb::Server::queryConnect != isItemChecked(IDC_QUERY_CONNECT)) ||
+                     (queryOnlyIfLoggedOn != isItemChecked(IDC_QUERY_LOGGED_ON)));
+          enableItem(IDC_QUERY_LOGGED_ON, enableQueryOnlyIfLoggedOn());
           return false;
         };
         return false;
       }
       bool onOk() {
+        bool useVncChanged = useVNC != isItemChecked(IDC_AUTH_VNC);
         useVNC = isItemChecked(IDC_AUTH_VNC);
         useNone = isItemChecked(IDC_AUTH_NONE);
         if (useVNC) {
-          CharArray password = vncAuthPasswd.getVncAuthPasswd();
-          if (!password.buf || strlen(password.buf) == 0) {
-            MsgBox(0, _T("The VNC authentication method is enabled, but no password is specified!  ")
-                      _T("The password dialog will now be shown."), MB_ICONEXCLAMATION | MB_OK);
-            passwd.showDialog();
-          }
+          verifyVncPassword(regKey);
           regKey.setString(_T("SecurityTypes"), _T("VncAuth"));
-        } else if (useNone) {
+        } else {
+          if (haveVncPassword() && useVncChanged &&
+              MsgBox(0, _T("The VNC authentication method is disabled, but a password is still stored for it.\n")
+                        _T("Do you want to remove the VNC authentication password from the registry?"),
+                        MB_ICONWARNING | MB_YESNO) == IDYES) {
+            regKey.setBinary(_T("Password"), 0, 0);
+          }
           regKey.setString(_T("SecurityTypes"), _T("None"));
         }
         regKey.setString(_T("ReverseSecurityTypes"), _T("None"));
         regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT));
+        regKey.setBool(_T("QueryOnlyIfLoggedOn"), isItemChecked(IDC_QUERY_LOGGED_ON));
         return true;
       }
       void setWarnPasswdInsecure(bool warn) {
-        passwd.setWarnPasswdInsecure(warn);
+        registryInsecure = warn;
+      }
+      bool enableQueryOnlyIfLoggedOn() {
+        return isItemChecked(IDC_QUERY_CONNECT) && osVersion.isPlatformNT && (osVersion.dwMajorVersion >= 5);
       }
+
+
+      static bool haveVncPassword() {
+        PlainPasswd password(SSecurityFactoryStandard::vncAuthPasswd.getVncAuthPasswd());
+        return password.buf && strlen(password.buf) != 0;
+      }
+
+      static void verifyVncPassword(const RegKey& regKey) {
+        if (!haveVncPassword()) {
+          MsgBox(0, _T("The VNC authentication method is enabled, but no password is specified.\n")
+                    _T("The password dialog will now be shown."), MB_ICONINFORMATION | MB_OK);
+          PasswordDialog passwd(regKey, registryInsecure);
+          passwd.showDialog();
+        }
+      }
+
     protected:
       RegKey regKey;
-      VncPasswdDialog passwd;
+      static bool registryInsecure;
       bool useNone;
       bool useVNC;
     };
 
   };
 
+  bool AuthenticationPage::registryInsecure = false;
+
 };
 
 #endif
index 133e81c1f444b86dd98c168d849a88714b956c88..7512cc65cf5027e7dc5c78cc644580c033b830f8 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2004 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -22,6 +22,7 @@
 
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
+#include <rfb_win32/ModuleFileName.h>
 #include <rfb/Configuration.h>
 #include <rfb/Blacklist.h>
 #include <network/TcpSocket.h>
@@ -43,42 +44,37 @@ namespace rfb {
     public:
       ConnHostDialog() : Dialog(GetModuleHandle(0)) {}
       bool showDialog(const TCHAR* pat) {
-        delete [] pattern.buf;
-        pattern.buf = tstrDup(pat);
+        pattern.replaceBuf(tstrDup(pat));
         return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST));
       }
       void initDialog() {
-        if (_tcslen(pattern.buf) == 0) {
-          delete [] pattern.buf;
-          pattern.buf = tstrDup(_T("+"));
-        }
+        if (_tcslen(pattern.buf) == 0)
+          pattern.replaceBuf(tstrDup("+"));
 
         if (pattern.buf[0] == _T('+'))
           setItemChecked(IDC_ALLOW, true);
+        else if (pattern.buf[0] == _T('?'))
+          setItemChecked(IDC_QUERY, true);
         else
           setItemChecked(IDC_DENY, true);
 
         setItemString(IDC_HOST_PATTERN, &pattern.buf[1]);
-
-        delete [] pattern.buf;
-        pattern.buf = 0;
+        pattern.replaceBuf(0);
       }
       bool onOk() {
-        delete [] pattern.buf;
-        pattern.buf = 0;
-
         TCharArray host = getItemString(IDC_HOST_PATTERN);
-
         TCharArray newPat(_tcslen(host.buf)+2);
         if (isItemChecked(IDC_ALLOW))
           newPat.buf[0] = _T('+');
+        else if (isItemChecked(IDC_QUERY))
+          newPat.buf[0] = _T('?');
         else
           newPat.buf[0] = _T('-');
         newPat.buf[1] = 0;
         _tcscat(newPat.buf, host.buf);
 
-        network::TcpFilter::Pattern pat = network::TcpFilter::parsePattern(CStr(newPat.buf));
-        pattern.buf = TCharArray(network::TcpFilter::patternToStr(pat)).takeBuf();
+        network::TcpFilter::Pattern pat(network::TcpFilter::parsePattern(CStr(newPat.buf)));
+        pattern.replaceBuf(TCharArray(network::TcpFilter::patternToStr(pat)).takeBuf());
         return true;
       }
       const TCHAR* getPattern() {return pattern.buf;}
@@ -92,10 +88,11 @@ namespace rfb {
         : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {}
       void initDialog() {
         vlog.debug("set IDC_PORT %d", (int)port_number);
-        setItemInt(IDC_PORT, port_number);
+        setItemInt(IDC_PORT, port_number ? port_number : 5900);
+        setItemChecked(IDC_RFB_ENABLE, port_number != 0);
         setItemInt(IDC_IDLE_TIMEOUT, rfb::Server::idleTimeout);
         vlog.debug("set IDC_HTTP_PORT %d", (int)http_port);
-        setItemInt(IDC_HTTP_PORT, http_port);
+        setItemInt(IDC_HTTP_PORT, http_port ? http_port : 5800);
         setItemChecked(IDC_HTTP_ENABLE, http_port != 0);
         enableItem(IDC_HTTP_PORT, http_port != 0);
         setItemChecked(IDC_LOCALHOST, localHost);
@@ -113,7 +110,7 @@ namespace rfb {
             SendMessage(listBox, LB_ADDSTRING, 0, (LPARAM)(const TCHAR*)TStr(first.buf));
         }
 
-        onCommand(IDC_HOSTS, EN_CHANGE);
+        onCommand(IDC_RFB_ENABLE, EN_CHANGE);
       }
       bool onCommand(int id, int cmd) {
         switch (id) {
@@ -133,8 +130,7 @@ namespace rfb {
         case IDC_PORT:
           if (cmd == EN_CHANGE) {
             try {
-              if (getItemInt(IDC_PORT) > 100)
-                setItemInt(IDC_HTTP_PORT, getItemInt(IDC_PORT)-100);
+              setItemInt(IDC_HTTP_PORT, rfbPortToHTTP(getItemInt(IDC_PORT)));
             } catch (...) {
             }
           }
@@ -145,19 +141,33 @@ namespace rfb {
           return false;
 
         case IDC_HTTP_ENABLE:
-          enableItem(IDC_HTTP_PORT, isItemChecked(IDC_HTTP_ENABLE));
-          setChanged(isChanged());
-          return false;
-
+        case IDC_RFB_ENABLE:
         case IDC_LOCALHOST:
-          enableItem(IDC_HOSTS, !isItemChecked(IDC_LOCALHOST));
-          enableItem(IDC_HOST_REMOVE, !isItemChecked(IDC_LOCALHOST));
-          enableItem(IDC_HOST_UP, !isItemChecked(IDC_LOCALHOST));
-          enableItem(IDC_HOST_DOWN, !isItemChecked(IDC_LOCALHOST));
-          enableItem(IDC_HOST_EDIT, !isItemChecked(IDC_LOCALHOST));
-          enableItem(IDC_HOST_ADD, !isItemChecked(IDC_LOCALHOST));
-          setChanged(isChanged());
-          return false;
+          {
+            // HTTP port
+            enableItem(IDC_HTTP_PORT, isItemChecked(IDC_HTTP_ENABLE) && isItemChecked(IDC_RFB_ENABLE));
+            enableItem(IDC_HTTP_ENABLE, isItemChecked(IDC_RFB_ENABLE));
+
+            // RFB port
+            enableItem(IDC_PORT, isItemChecked(IDC_RFB_ENABLE));
+
+            // Hosts
+            enableItem(IDC_LOCALHOST, isItemChecked(IDC_RFB_ENABLE));
+
+            bool enableHosts = !isItemChecked(IDC_LOCALHOST) && isItemChecked(IDC_RFB_ENABLE);
+            enableItem(IDC_HOSTS, enableHosts);
+            enableItem(IDC_HOST_ADD, enableHosts);
+            if (!enableHosts) {
+              enableItem(IDC_HOST_REMOVE, enableHosts);
+              enableItem(IDC_HOST_UP, enableHosts);
+              enableItem(IDC_HOST_DOWN, enableHosts);
+              enableItem(IDC_HOST_EDIT, enableHosts);
+            } else {
+              onCommand(IDC_HOSTS, EN_CHANGE);
+            }
+            setChanged(isChanged());
+            return false;
+          }
 
         case IDC_HOST_ADD:
           if (hostDialog.showDialog(_T("")))
@@ -228,11 +238,11 @@ namespace rfb {
         return false;
       }
       bool onOk() {
-        regKey.setInt(_T("PortNumber"), getItemInt(IDC_PORT));
-        regKey.setInt(_T("LocalHost"), isItemChecked(IDC_LOCALHOST));
+        regKey.setInt(_T("PortNumber"), isItemChecked(IDC_RFB_ENABLE) ? getItemInt(IDC_PORT) : 0);
         regKey.setInt(_T("IdleTimeout"), getItemInt(IDC_IDLE_TIMEOUT));
-        regKey.setInt(_T("HTTPPortNumber"), isItemChecked(IDC_HTTP_ENABLE) ? getItemInt(IDC_HTTP_PORT) : 0);
-
+        regKey.setInt(_T("HTTPPortNumber"), isItemChecked(IDC_HTTP_ENABLE) && isItemChecked(IDC_RFB_ENABLE)
+                                            ? getItemInt(IDC_HTTP_PORT) : 0);
+        regKey.setInt(_T("LocalHost"), isItemChecked(IDC_LOCALHOST));
         regKey.setString(_T("Hosts"), TCharArray(getHosts()).buf);
         return true;
       }
@@ -266,6 +276,16 @@ namespace rfb {
         }
         return strDup(hosts_str.buf);
       }
+      int rfbPortToHTTP(int rfbPort) {
+        int offset = -100;
+        if (http_port)
+          offset = http_port - port_number;
+        int httpPort = rfbPort + offset;
+        if (httpPort <= 0)
+          httpPort = rfbPort;
+        return httpPort;
+      }
+
     protected:
       RegKey regKey;
       ConnHostDialog hostDialog;
@@ -275,4 +295,4 @@ namespace rfb {
 
 };
 
-#endif
\ No newline at end of file
+#endif
index a0a325a3114aa9fd7c3648d16d7a6eb3649fda0d..164269a298a80009616a1719ac8824dfeb765939 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -21,6 +21,7 @@
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
 #include <rfb_win32/SDisplay.h>
+#include <rfb_win32/DynamicFn.h>
 
 namespace rfb {
 
@@ -90,4 +91,4 @@ namespace rfb {
 
 };
 
-#endif
\ No newline at end of file
+#endif
index b9bec15a1dc6bc2088c9e096dd1e18eff905694a..9be82f3a69f8cde8a7b54778a0e31ec203a0811c 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -21,6 +21,7 @@
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
 #include <rfb_win32/SDisplay.h>
+#include <rfb_win32/WMPoller.h>
 #include <rfb/ServerCore.h>
 
 namespace rfb {
@@ -32,26 +33,48 @@ namespace rfb {
       HookingPage(const RegKey& rk)
         : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {}
       void initDialog() {
-        setItemChecked(IDC_USEHOOKS, rfb::win32::SDisplay::use_hooks);
+        setItemChecked(IDC_USEPOLLING, rfb::win32::SDisplay::updateMethod == 0);
+        setItemChecked(IDC_USEHOOKS, (rfb::win32::SDisplay::updateMethod == 1) &&
+                       rfb::win32::SDisplay::areHooksAvailable());
+        enableItem(IDC_USEHOOKS, rfb::win32::SDisplay::areHooksAvailable());
+        setItemChecked(IDC_USEDRIVER, (rfb::win32::SDisplay::updateMethod == 2) &&
+                       rfb::win32::SDisplay::isDriverAvailable());
+        enableItem(IDC_USEDRIVER, rfb::win32::SDisplay::isDriverAvailable());
         setItemChecked(IDC_POLLCONSOLES, rfb::win32::WMPoller::poll_console_windows);
-        setItemChecked(IDC_COMPAREFB, rfb::Server::compareFB);
+        setItemChecked(IDC_CAPTUREBLT, osVersion.isPlatformNT &&
+                       rfb::win32::DeviceFrameBuffer::useCaptureBlt);
+        enableItem(IDC_CAPTUREBLT, osVersion.isPlatformNT);
+        onCommand(IDC_USEHOOKS, 0);
       }
       bool onCommand(int id, int cmd) {
         switch (id) {
+        case IDC_USEPOLLING:
         case IDC_USEHOOKS:
+        case IDC_USEDRIVER:
         case IDC_POLLCONSOLES:
-        case IDC_COMPAREFB:
-          setChanged((rfb::win32::SDisplay::use_hooks != isItemChecked(IDC_USEHOOKS)) ||
+        case IDC_CAPTUREBLT:
+          setChanged(((rfb::win32::SDisplay::updateMethod == 0) != isItemChecked(IDC_USEPOLLING)) ||
+            ((rfb::win32::SDisplay::updateMethod == 1) != isItemChecked(IDC_USEHOOKS)) ||
+            ((rfb::win32::SDisplay::updateMethod == 2) != isItemChecked(IDC_USEDRIVER)) ||
             (rfb::win32::WMPoller::poll_console_windows != isItemChecked(IDC_POLLCONSOLES)) ||
-            (rfb::Server::compareFB != isItemChecked(IDC_COMPAREFB)));
+            (rfb::win32::DeviceFrameBuffer::useCaptureBlt != isItemChecked(IDC_CAPTUREBLT)));
+          enableItem(IDC_POLLCONSOLES, isItemChecked(IDC_USEHOOKS));
           break;
         }
         return false;
       }
       bool onOk() {
-        regKey.setBool(_T("UseHooks"), isItemChecked(IDC_USEHOOKS));
+        if (isItemChecked(IDC_USEPOLLING))
+          regKey.setInt(_T("UpdateMethod"), 0);
+        if (isItemChecked(IDC_USEHOOKS))
+          regKey.setInt(_T("UpdateMethod"), 1);
+        if (isItemChecked(IDC_USEDRIVER))
+          regKey.setInt(_T("UpdateMethod"), 2);
         regKey.setBool(_T("PollConsoleWindows"), isItemChecked(IDC_POLLCONSOLES));
-        regKey.setBool(_T("CompareFB"), isItemChecked(IDC_COMPAREFB));
+        regKey.setBool(_T("UseCaptureBlt"), isItemChecked(IDC_CAPTUREBLT));
+
+        // *** LEGACY compatibility ***
+        regKey.setBool(_T("UseHooks"), isItemChecked(IDC_USEHOOKS));
         return true;
       }
     protected:
@@ -62,4 +85,4 @@ namespace rfb {
 
 };
 
-#endif
\ No newline at end of file
+#endif
index 2735d24a955c3f5180861a6d9ac8a255c71a1188..1e0b4bac5670daabda5d6a3132ab808316d1532d 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
 
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
+#include <rfb_win32/OSVersion.h>
 #include <rfb/ServerCore.h>
 
 namespace rfb {
-
   namespace win32 {
 
     class InputsPage : public PropSheetPage {
@@ -42,6 +42,7 @@ namespace rfb {
         setItemChecked(IDC_ACCEPT_CUTTEXT, rfb::Server::acceptCutText);
         setItemChecked(IDC_SEND_CUTTEXT, rfb::Server::sendCutText);
         setItemChecked(IDC_DISABLE_LOCAL_INPUTS, SDisplay::disableLocalInputs);
+        enableItem(IDC_DISABLE_LOCAL_INPUTS, !osVersion.isPlatformWindows);
         BOOL blocked = FALSE;
         if (SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &blocked, 0))
           setItemChecked(IDC_AFFECT_SCREENSAVER, !blocked);
@@ -78,7 +79,6 @@ namespace rfb {
     };
 
   };
-
 };
 
-#endif
\ No newline at end of file
+#endif
index 592665141dfce9356998f396f3b61c46345635b9..ae5d716655cd5c5ac12b4de0e64dfe26c204f796 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2004 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -19,6 +19,7 @@
 #include <vncconfig/Legacy.h>
 
 #include <rfb/LogWriter.h>
+#include <rfb/Password.h>
 #include <rfb_win32/CurrentUser.h>
 
 using namespace rfb;
@@ -216,10 +217,9 @@ void LegacyPage::LoadPrefs()
         }
         regKey.setInt(_T("QueryTimeout"), key.getInt(_T("QueryTimeout"), 10));
 
-        rfb::CharArray passwd;
-        int length;
-        key.getBinary(_T("Password"), (void**)&passwd.buf, &length, 0, 0);
-        regKey.setBinary(_T("Password"), passwd.buf, length);
+        ObfuscatedPasswd passwd;
+        key.getBinary(_T("Password"), (void**)&passwd.buf, &passwd.length, 0, 0);
+        regKey.setBinary(_T("Password"), passwd.buf, passwd.length);
 
         bool enableInputs = key.getBool(_T("InputsEnabled"), true);
         regKey.setBool(_T("AcceptKeyEvents"), enableInputs);
index e66dc56b5890311b0414390f6617fc4d3ab0ef84..02059a643c1a5668e84bfdbabf94d5db4fc411ab 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
 #ifndef WINVNCCONF_LEGACY
 #define WINVNCCONF_LEGACY
 
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <lmcons.h>
-
 #include <vncconfig/resource.h>
 #include <rfb_win32/Registry.h>
 #include <rfb_win32/Dialog.h>
-#include <rfb_win32/Win32Util.h>
+#include <rfb_win32/MsgBox.h>
 #include <rfb/ServerCore.h>
+#include <rfb/secTypes.h>
 
 namespace rfb {
 
@@ -83,4 +82,4 @@ namespace rfb {
 
 };
 
-#endif
\ No newline at end of file
+#endif
diff --git a/vncconfig/PasswordDialog.cxx b/vncconfig/PasswordDialog.cxx
new file mode 100644 (file)
index 0000000..d26d86f
--- /dev/null
@@ -0,0 +1,52 @@
+/* Copyright (C) 2004-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ */
+
+#include <vncconfig/resource.h>
+#include <vncconfig/PasswordDialog.h>
+#include <rfb_win32/MsgBox.h>
+#include <rfb/Password.h>
+
+using namespace rfb;
+using namespace win32;
+
+PasswordDialog::PasswordDialog(const RegKey& rk, bool registryInsecure_)
+  : Dialog(GetModuleHandle(0)), regKey(rk), registryInsecure(registryInsecure_) {
+}
+
+bool PasswordDialog::showDialog(HWND owner) {
+  return Dialog::showDialog(MAKEINTRESOURCE(IDD_AUTH_VNC_PASSWD), owner);
+}
+
+bool PasswordDialog::onOk() {
+  TPlainPasswd password1(getItemString(IDC_PASSWORD1));
+  TPlainPasswd password2(getItemString(IDC_PASSWORD2));
+  if (_tcscmp(password1.buf, password2.buf) != 0) {
+    MsgBox(0, _T("The supplied passwords do not match"),
+           MB_ICONEXCLAMATION | MB_OK);
+    return false;
+  }
+  if (registryInsecure &&
+      (MsgBox(0, _T("Please note that your password cannot be stored securely on this system.  ")
+                 _T("Are you sure you wish to continue?"),
+              MB_YESNO | MB_ICONWARNING) == IDNO))
+    return false;
+  PlainPasswd password(strDup(password1.buf));
+  ObfuscatedPasswd obfPwd(password);
+  regKey.setBinary(_T("Password"), obfPwd.buf, obfPwd.length);
+  return true;
+}
diff --git a/vncconfig/PasswordDialog.h b/vncconfig/PasswordDialog.h
new file mode 100644 (file)
index 0000000..dd23f8e
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright (C) 2004-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+ * USA.
+ */
+#ifndef WINVNCCONF_PASSWORD_DIALOG
+#define WINVNCCONF_PASSWORD_DIALOG
+
+#include <rfb_win32/Registry.h>
+#include <rfb_win32/Dialog.h>
+
+namespace rfb {
+  namespace win32 {
+
+    class PasswordDialog : public Dialog {
+    public:
+      PasswordDialog(const RegKey& rk, bool registryInsecure_);
+      bool showDialog(HWND owner=0);
+      bool onOk();
+    protected:
+      const RegKey& regKey;
+      bool registryInsecure;
+    };
+
+  };
+};
+
+#endif
\ No newline at end of file
index b63b39ad52748a3281e3cc9f4216965662c56202..872ae1332bb4f48968f88ea59cb9069705b70e05 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2003 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -56,4 +56,4 @@ namespace rfb {
 
 };
 
-#endif
\ No newline at end of file
+#endif
index 99e2cea3f8c90476677872afbd92111cd90b8575..ca1fbf5af6f710351d87b55a71cc0bea344d69e3 100644 (file)
@@ -37,6 +37,7 @@
 #define IDC_HOST_UP                     1019
 #define IDC_BUTTON4                     1020
 #define IDC_HOST_DOWN                   1020
+#define IDC_AUTH_INPUTONLY_PASSWD       1020
 #define IDC_HOST_EDIT                   1021
 #define IDC_PASSWORD2                   1022
 #define IDC_LEGACY_IMPORT               1023
 #define IDC_COPYRIGHT                   1042
 #define IDC_HTTP_ENABLE                 1043
 #define IDC_HTTP_PORT                   1044
-#define A                               1045
 #define IDC_BL_THRESHOLD                1046
 #define IDC_BL_TIMEOUT                  1047
 #define IDC_AFFECT_SCREENSAVER          1048
 #define IDC_LOCALHOST                   1049
 #define IDC_DISABLE_LOCAL_INPUTS        1050
-#define IDC_QUERY_CONNECT               1051
+#define IDC_AUTH_NT                     1051
+#define IDC_AUTH_NT_CONF                1052
+#define IDC_AUTH_RA2_CONF               1053
+#define IDC_QUERY_CONNECT               1055
 #define IDC_DISCONNECT_NONE             1056
 #define IDC_DISCONNECT_LOCK             1057
 #define IDC_DISCONNECT_LOGOFF           1058
 #define IDC_REMOVE_WALLPAPER            1059
 #define IDC_REMOVE_PATTERN              1060
 #define IDC_DISABLE_EFFECTS             1061
+#define IDC_CAPTUREBLT                  1062
+#define IDC_ENCRYPTION                  1063
+#define IDC_QUERY                       1064
+#define IDC_USEPOLLING                  1066
+#define IDC_USEDRIVER                   1068
+#define IDC_QUERY_LOGGED_ON             1069
+#define IDC_AUTH_ADMIN_PASSWD           1076
+#define IDC_AUTH_VIEWONLY_PASSWD        1077
+#define IDC_AUTH_ADMIN_ENABLE           1078
+#define IDC_AUTH_VIEWONLY_ENABLE        1079
+#define IDC_AUTH_INPUTONLY_ENABLE       1080
+#define IDC_AUTH_VNC_EXT                1081
+#define IDC_RFB_ENABLE                  1082
 #define ID_OPTIONS                      40001
 #define ID_CLOSE                        40002
 #define ID_ABOUT                        40003
@@ -80,7 +96,7 @@
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        117
 #define _APS_NEXT_COMMAND_VALUE         40004
-#define _APS_NEXT_CONTROL_VALUE         1062
+#define _APS_NEXT_CONTROL_VALUE         1083
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
index b03f47a9cf5dd7321dd49399289fe744404bf879..6c9e1c5ad8dd76a242755f40e6f9138e9c84191d 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2002-2004 RealVNC Ltd.  All Rights Reserved.
- *    
+/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+ * 
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -16,7 +16,6 @@
  * USA.
  */
 
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <commctrl.h>
 #include <string.h>
@@ -50,8 +49,6 @@ static LogWriter vlog("main");
 TStr rfb::win32::AppName("VNC Config");
 
 
-VncAuthPasswdConfigParameter vncAuthPasswd;
-
 #ifdef _DEBUG
 BoolParameter captureDialogs("CaptureDialogs", "", false);
 #endif
@@ -119,14 +116,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) {
       bool warnOnChangePassword = false;
       try {
         AccessEntries access;
-        Sid adminSID = Sid::Administrators();
-        Sid systemSID = Sid::SYSTEM();
+        Sid::Administrators adminSID;
+        Sid::SYSTEM systemSID;
         access.addEntry(adminSID, KEY_ALL_ACCESS, GRANT_ACCESS);
         access.addEntry(systemSID, KEY_ALL_ACCESS, GRANT_ACCESS);
-        UserName user;
+        UserSID userSID;
         if (configKey == HKEY_CURRENT_USER)
-          access.addEntry(user.buf, KEY_ALL_ACCESS, GRANT_ACCESS);
-        AccessControlList acl = CreateACL(access);
+          access.addEntry(userSID, KEY_ALL_ACCESS, GRANT_ACCESS);
+        AccessControlList acl(CreateACL(access));
 
         // Set the DACL, and don't allow the key to inherit its parent's DACL
         rootKey.setDACL(acl, false);
@@ -145,9 +142,9 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) {
         warnOnChangePassword = true;
       }
 
-      // Start the RegConfig reader, to load in existing settings
-      RegistryReader config;
-      config.setKey(configKey, _T("Software\\TightVNC\\WinVNC4"));
+      // Start a RegConfig thread, to load in existing settings
+      RegConfigThread config;
+      config.start(configKey, _T("Software\\TightVNC\\WinVNC4"));
 
       // Build the dialog
       std::list<PropSheetPage*> pages;
@@ -175,8 +172,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) {
 #else
       sheet.showPropSheet(0, true, false);
 #endif
-
-      return 0;
     } catch (rdr::SystemException& e) {
       switch (e.err) {
       case ERROR_ACCESS_DENIED:
@@ -186,8 +181,11 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) {
       };
       throw;
     }
+
   } catch (rdr::Exception& e) {
     MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK);
     return 1;
   }
+
+  return 0;
 }
index 8181fe70b1e763debbe4f12527aa20a970dc1af6..42d3bb2838dcfb168136e266650dc582c12fa797 100644 (file)
@@ -125,6 +125,10 @@ SOURCE=.\Legacy.cxx
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\PasswordDialog.cxx\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\vncconfig.cxx\r
 # End Source File\r
 # End Group\r
@@ -157,6 +161,10 @@ SOURCE=.\Legacy.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\PasswordDialog.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\resource.h\r
 # End Source File\r
 # Begin Source File\r
index b40189294faa9d3662353cc7dc197631bfd77607..bf2f9696714ae364e0be3150d8a13cbaae71f1d3 100644 (file)
@@ -61,19 +61,29 @@ IDI_ICON                ICON    DISCARDABLE     "vncconfig.ico"
 // Dialog
 //
 
-IDD_AUTHENTICATION DIALOG DISCARDABLE  0, 0, 225, 86
+IDD_AUTHENTICATION DIALOG DISCARDABLE  0, 0, 193, 135
 STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Authentication"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL         "No Authentication or Encryption",IDC_AUTH_NONE,"Button",
-                    BS_AUTORADIOBUTTON | WS_GROUP,7,10,143,15
-    CONTROL         "VNC 3.3 Authentication, no Encryption",IDC_AUTH_VNC,
-                    "Button",BS_AUTORADIOBUTTON,7,30,143,15
-    PUSHBUTTON      "Set Password",IDC_AUTH_VNC_PASSWD,155,30,55,15
-    CONTROL         "Prompt local user to accept incoming connections",
+    CONTROL         "No Authentication",IDC_AUTH_NONE,"Button",
+                    BS_AUTORADIOBUTTON | WS_GROUP,7,10,113,15
+    CONTROL         "VNC Password Authentication",IDC_AUTH_VNC,"Button",
+                    BS_AUTORADIOBUTTON,7,30,113,15
+    PUSHBUTTON      "Configure",IDC_AUTH_VNC_PASSWD,125,30,61,15
+    CONTROL         "NT Logon Authentication",IDC_AUTH_NT,"Button",
+                    BS_AUTORADIOBUTTON,7,50,113,15
+    PUSHBUTTON      "Configure",IDC_AUTH_NT_CONF,125,50,61,15
+    LTEXT           "Encryption:",IDC_STATIC,7,70,42,15,SS_CENTERIMAGE
+    COMBOBOX        IDC_ENCRYPTION,49,70,71,50,CBS_DROPDOWN | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "Generate Keys",IDC_AUTH_RA2_CONF,125,70,61,15
+    CONTROL         "Prompt local user to accept connections",
                     IDC_QUERY_CONNECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
-                    7,50,211,15
+                    7,95,181,15
+    CONTROL         "Only prompt when there is a user logged on",
+                    IDC_QUERY_LOGGED_ON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,20,110,166,15
 END
 
 IDD_CONNECTIONS DIALOG DISCARDABLE  0, 0, 218, 198
@@ -81,11 +91,11 @@ STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Connections"
 FONT 8, "MS Sans Serif"
 BEGIN
-    LTEXT           "Accept connections on port:",IDC_STATIC,7,10,138,15,
-                    SS_CENTERIMAGE
+    CONTROL         "Accept connections on port:",IDC_RFB_ENABLE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,10,138,15
+    EDITTEXT        IDC_PORT,150,10,61,15,ES_AUTOHSCROLL | ES_NUMBER
     LTEXT           "Disconnect idle clients after (seconds):",IDC_STATIC,7,
                     25,138,15,SS_CENTERIMAGE
-    EDITTEXT        IDC_PORT,150,10,61,15,ES_AUTOHSCROLL | ES_NUMBER
     EDITTEXT        IDC_IDLE_TIMEOUT,150,25,61,15,ES_AUTOHSCROLL | ES_NUMBER
     CONTROL         "Serve Java viewer via HTTP on port:",IDC_HTTP_ENABLE,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,138,15
@@ -103,32 +113,35 @@ BEGIN
     PUSHBUTTON      "&Edit",IDC_HOST_EDIT,150,170,55,15
 END
 
-IDD_HOOKING DIALOG DISCARDABLE  0, 0, 198, 95
+IDD_HOOKING DIALOG DISCARDABLE  0, 0, 197, 101
 STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Hooks"
+CAPTION "Capture Method"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL         "Use VNC hooks to track graphical updates",IDC_USEHOOKS,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,10,184,15
+    CONTROL         "Poll for changes to the desktop",IDC_USEPOLLING,"Button",
+                    BS_AUTORADIOBUTTON | WS_GROUP,7,10,183,15
+    CONTROL         "Use VNC hooks to track changes",IDC_USEHOOKS,"Button",
+                    BS_AUTORADIOBUTTON,7,25,183,15
     CONTROL         "Poll console windows for updates",IDC_POLLCONSOLES,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,184,15
-    CONTROL         "Filter out updates that have no effect (recommended)",
-                    IDC_COMPAREFB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,
-                    184,15
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,40,165,15
+    CONTROL         "Use VNC Mirror driver to track changes",IDC_USEDRIVER,
+                    "Button",BS_AUTORADIOBUTTON,7,55,183,15
+    CONTROL         "Capture alpha-blended windows",IDC_CAPTUREBLT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,70,183,15
 END
 
 IDD_AUTH_VNC_PASSWD DIALOG DISCARDABLE  0, 0, 212, 70
 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | 
     WS_SYSMENU
-CAPTION "WinVNC Password"
+CAPTION "VNC Server Password"
 FONT 8, "MS Sans Serif"
 BEGIN
+    LTEXT           "New Password:",IDC_STATIC,7,10,63,15
     EDITTEXT        IDC_PASSWORD1,75,10,130,15,ES_PASSWORD | ES_AUTOHSCROLL
+    LTEXT           "Confirm Password:",IDC_STATIC,7,30,63,14
     EDITTEXT        IDC_PASSWORD2,75,30,130,14,ES_PASSWORD | ES_AUTOHSCROLL
-    LTEXT           "New Password:",IDC_STATIC,7,10,63,15
     DEFPUSHBUTTON   "OK",IDOK,100,50,50,15
     PUSHBUTTON      "Cancel",IDCANCEL,155,50,50,15
-    LTEXT           "Confirm Password:",IDC_STATIC,7,30,63,14
 END
 
 IDD_LEGACY DIALOG DISCARDABLE  0, 0, 166, 92
@@ -141,18 +154,19 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,35,152,15
 END
 
-IDD_CONN_HOST DIALOG DISCARDABLE  0, 0, 225, 47
+IDD_CONN_HOST DIALOG DISCARDABLE  0, 0, 225, 57
 STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
 CAPTION "Specify Host IP Address Pattern"
 FONT 8, "MS Sans Serif"
 BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,168,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,168,24,50,14
+    EDITTEXT        IDC_HOST_PATTERN,65,5,100,15,ES_AUTOHSCROLL
     CONTROL         "&Allow",IDC_ALLOW,"Button",BS_AUTORADIOBUTTON | 
-                    WS_GROUP,7,7,53,16
-    CONTROL         "&Deny",IDC_DENY,"Button",BS_AUTORADIOBUTTON,7,23,53,15
-    EDITTEXT        IDC_HOST_PATTERN,65,7,100,16,ES_AUTOHSCROLL
-    LTEXT           "e.g. 192.168.0.0/255.255.0.0",IDC_STATIC,65,25,100,15
+                    WS_GROUP,7,5,53,15
+    CONTROL         "&Deny",IDC_DENY,"Button",BS_AUTORADIOBUTTON,7,20,53,15
+    CONTROL         "Query",IDC_QUERY,"Button",BS_AUTORADIOBUTTON,7,35,53,15
+    DEFPUSHBUTTON   "OK",IDOK,115,35,50,15
+    PUSHBUTTON      "Cancel",IDCANCEL,170,35,50,15
+    LTEXT           "e.g. 192.168.0.0/255.255.0.0",IDC_STATIC,65,20,100,15
 END
 
 IDD_SHARING DIALOG DISCARDABLE  0, 0, 186, 95
@@ -177,10 +191,10 @@ STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Inputs"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL         "Accept keyboard events from clients",IDC_ACCEPT_KEYS,
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,172,15
     CONTROL         "Accept pointer events from clients",IDC_ACCEPT_PTR,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,10,172,15
+    CONTROL         "Accept keyboard events from clients",IDC_ACCEPT_KEYS,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,25,172,15
     CONTROL         "Accept clipboard updates from clients",
                     IDC_ACCEPT_CUTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     7,40,172,15
@@ -216,13 +230,6 @@ STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CONTROL | WS_POPUP | WS_CAPTION |
 CAPTION "Desktop"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL         "Do nothing",IDC_DISCONNECT_NONE,"Button",
-                    BS_AUTORADIOBUTTON,15,80,155,15
-    CONTROL         "Lock workstation",IDC_DISCONNECT_LOCK,"Button",
-                    BS_AUTORADIOBUTTON,15,95,155,15
-    CONTROL         "Logoff user",IDC_DISCONNECT_LOGOFF,"Button",
-                    BS_AUTORADIOBUTTON,15,110,155,15
-    GROUPBOX        "When last client disconnects",IDC_STATIC,7,70,171,60
     GROUPBOX        "While connected",IDC_STATIC,7,5,171,60
     CONTROL         "Remove wallpaper",IDC_REMOVE_WALLPAPER,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,15,15,155,15
@@ -230,6 +237,13 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,15,30,155,15
     CONTROL         "Disable user interface effects",IDC_DISABLE_EFFECTS,
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,46,155,14
+    GROUPBOX        "When last client disconnects",IDC_STATIC,7,70,171,60
+    CONTROL         "Do nothing",IDC_DISCONNECT_NONE,"Button",
+                    BS_AUTORADIOBUTTON,15,80,155,15
+    CONTROL         "Lock workstation",IDC_DISCONNECT_LOCK,"Button",
+                    BS_AUTORADIOBUTTON,15,95,155,15
+    CONTROL         "Logoff user",IDC_DISCONNECT_LOGOFF,"Button",
+                    BS_AUTORADIOBUTTON,15,110,155,15
 END
 
 
@@ -244,18 +258,25 @@ BEGIN
     IDD_AUTHENTICATION, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 218
-        VERTGUIDE, 150
-        VERTGUIDE, 155
-        VERTGUIDE, 210
+        RIGHTMARGIN, 186
+        VERTGUIDE, 20
+        VERTGUIDE, 49
+        VERTGUIDE, 120
+        VERTGUIDE, 125
         TOPMARGIN, 7
-        BOTTOMMARGIN, 79
+        BOTTOMMARGIN, 128
         HORZGUIDE, 10
         HORZGUIDE, 25
         HORZGUIDE, 30
         HORZGUIDE, 45
         HORZGUIDE, 50
         HORZGUIDE, 65
+        HORZGUIDE, 70
+        HORZGUIDE, 85
+        HORZGUIDE, 90
+        HORZGUIDE, 105
+        HORZGUIDE, 110
+        HORZGUIDE, 125
     END
 
     IDD_CONNECTIONS, DIALOG
@@ -290,13 +311,16 @@ BEGIN
     IDD_HOOKING, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 191
+        RIGHTMARGIN, 190
+        VERTGUIDE, 25
         TOPMARGIN, 7
-        BOTTOMMARGIN, 88
+        BOTTOMMARGIN, 94
         HORZGUIDE, 10
         HORZGUIDE, 25
         HORZGUIDE, 40
         HORZGUIDE, 55
+        HORZGUIDE, 70
+        HORZGUIDE, 85
     END
 
     IDD_AUTH_VNC_PASSWD, DIALOG
@@ -305,6 +329,7 @@ BEGIN
         RIGHTMARGIN, 205
         VERTGUIDE, 70
         VERTGUIDE, 75
+        VERTGUIDE, 90
         VERTGUIDE, 100
         VERTGUIDE, 150
         VERTGUIDE, 155
@@ -334,12 +359,16 @@ BEGIN
     IDD_CONN_HOST, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 218
+        RIGHTMARGIN, 220
         VERTGUIDE, 60
         VERTGUIDE, 65
+        VERTGUIDE, 115
         VERTGUIDE, 165
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 40
+        VERTGUIDE, 170
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 50
+        HORZGUIDE, 20
+        HORZGUIDE, 35
     END
 
     IDD_SHARING, DIALOG
@@ -390,21 +419,9 @@ BEGIN
     IDD_DESKTOP, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 178
-        VERTGUIDE, 15
-        VERTGUIDE, 170
-        TOPMARGIN, 5
-        BOTTOMMARGIN, 130
-        HORZGUIDE, 15
-        HORZGUIDE, 30
-        HORZGUIDE, 45
-        HORZGUIDE, 60
-        HORZGUIDE, 65
-        HORZGUIDE, 70
-        HORZGUIDE, 80
-        HORZGUIDE, 95
-        HORZGUIDE, 110
-        HORZGUIDE, 125
+        RIGHTMARGIN, 182
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 32
     END
 END
 #endif    // APSTUDIO_INVOKED
@@ -417,8 +434,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,0,0,26
- PRODUCTVERSION 4,0,0,26
+ FILEVERSION 4,1,1,0
+ PRODUCTVERSION 4,1,1,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -435,15 +452,15 @@ BEGIN
         BEGIN
             VALUE "Comments", "\0"
             VALUE "CompanyName", "Constantin Kaplinsky\0"
-            VALUE "FileDescription", "VNC Server Configuration Applet for Win32\0"
-            VALUE "FileVersion", "4.0\0"
-            VALUE "InternalName", "VNC Config 4.0\0"
-            VALUE "LegalCopyright", "Copyright (C) 1998-2004 [many holders]\0"
+            VALUE "FileDescription", "TightVNC Server Configuration Applet for Win32\0"
+            VALUE "FileVersion", "4.1.1\0"
+            VALUE "InternalName", "vncconfig\0"
+            VALUE "LegalCopyright", "Copyright (C) 1998-2005 [many holders]\0"
             VALUE "LegalTrademarks", "TightVNC\0"
             VALUE "OriginalFilename", "vncconfig.exe\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "TightVNC Config 4.0\0"
-            VALUE "ProductVersion", "4.0\0"
+            VALUE "ProductName", "TightVNC Configurator\0"
+            VALUE "ProductVersion", "4.1.1\0"
             VALUE "SpecialBuild", "\0"
         END
     END