git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/merge-with-vnc-4.1.1@547 3789f03b-4d11-0410-bbf8-ca57d06f2519tags/v0.0.90
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#ifndef WINVNCCONF_AUTHENTICATION | #ifndef WINVNCCONF_AUTHENTICATION | ||||
#define WINVNCCONF_AUTHENTICATION | #define WINVNCCONF_AUTHENTICATION | ||||
#include <vncconfig/PasswordDialog.h> | |||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.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/ServerCore.h> | ||||
#include <rfb/secTypes.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 rfb { | ||||
namespace win32 { | 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 { | class AuthenticationPage : public PropSheetPage { | ||||
public: | public: | ||||
AuthenticationPage(const RegKey& rk) | AuthenticationPage(const RegKey& rk) | ||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_AUTHENTICATION)), | |||||
passwd(rk), regKey(rk) {} | |||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_AUTHENTICATION)), regKey(rk) {} | |||||
void initDialog() { | 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); | std::list<int> sec_types = parseSecTypes(sec_types_str.buf); | ||||
useNone = useVNC = false; | useNone = useVNC = false; | ||||
else if ((*i) == secTypeVncAuth) useVNC = true; | 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_NONE, useNone); | ||||
setItemChecked(IDC_AUTH_VNC, useVNC); | setItemChecked(IDC_AUTH_VNC, useVNC); | ||||
setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect); | setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect); | ||||
setItemChecked(IDC_QUERY_LOGGED_ON, queryOnlyIfLoggedOn); | |||||
onCommand(IDC_AUTH_NONE, 0); | |||||
} | } | ||||
bool onCommand(int id, int cmd) { | bool onCommand(int id, int cmd) { | ||||
switch (id) { | switch (id) { | ||||
case IDC_AUTH_VNC_PASSWD: | case IDC_AUTH_VNC_PASSWD: | ||||
passwd.showDialog(); | |||||
{ | |||||
PasswordDialog passwdDlg(regKey, registryInsecure); | |||||
passwdDlg.showDialog(handle); | |||||
} | |||||
return true; | return true; | ||||
case IDC_AUTH_NONE: | case IDC_AUTH_NONE: | ||||
case IDC_AUTH_VNC: | case IDC_AUTH_VNC: | ||||
enableItem(IDC_AUTH_VNC_PASSWD, isItemChecked(IDC_AUTH_VNC)); | |||||
case IDC_QUERY_CONNECT: | 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; | ||||
}; | }; | ||||
return false; | return false; | ||||
} | } | ||||
bool onOk() { | bool onOk() { | ||||
bool useVncChanged = useVNC != isItemChecked(IDC_AUTH_VNC); | |||||
useVNC = isItemChecked(IDC_AUTH_VNC); | useVNC = isItemChecked(IDC_AUTH_VNC); | ||||
useNone = isItemChecked(IDC_AUTH_NONE); | useNone = isItemChecked(IDC_AUTH_NONE); | ||||
if (useVNC) { | 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")); | 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("SecurityTypes"), _T("None")); | ||||
} | } | ||||
regKey.setString(_T("ReverseSecurityTypes"), _T("None")); | regKey.setString(_T("ReverseSecurityTypes"), _T("None")); | ||||
regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT)); | regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT)); | ||||
regKey.setBool(_T("QueryOnlyIfLoggedOn"), isItemChecked(IDC_QUERY_LOGGED_ON)); | |||||
return true; | return true; | ||||
} | } | ||||
void setWarnPasswdInsecure(bool warn) { | 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: | protected: | ||||
RegKey regKey; | RegKey regKey; | ||||
VncPasswdDialog passwd; | |||||
static bool registryInsecure; | |||||
bool useNone; | bool useNone; | ||||
bool useVNC; | bool useVNC; | ||||
}; | }; | ||||
}; | }; | ||||
bool AuthenticationPage::registryInsecure = false; | |||||
}; | }; | ||||
#endif | #endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.h> | #include <rfb_win32/Dialog.h> | ||||
#include <rfb_win32/ModuleFileName.h> | |||||
#include <rfb/Configuration.h> | #include <rfb/Configuration.h> | ||||
#include <rfb/Blacklist.h> | #include <rfb/Blacklist.h> | ||||
#include <network/TcpSocket.h> | #include <network/TcpSocket.h> | ||||
public: | public: | ||||
ConnHostDialog() : Dialog(GetModuleHandle(0)) {} | ConnHostDialog() : Dialog(GetModuleHandle(0)) {} | ||||
bool showDialog(const TCHAR* pat) { | bool showDialog(const TCHAR* pat) { | ||||
delete [] pattern.buf; | |||||
pattern.buf = tstrDup(pat); | |||||
pattern.replaceBuf(tstrDup(pat)); | |||||
return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST)); | return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST)); | ||||
} | } | ||||
void initDialog() { | 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('+')) | if (pattern.buf[0] == _T('+')) | ||||
setItemChecked(IDC_ALLOW, true); | setItemChecked(IDC_ALLOW, true); | ||||
else if (pattern.buf[0] == _T('?')) | |||||
setItemChecked(IDC_QUERY, true); | |||||
else | else | ||||
setItemChecked(IDC_DENY, true); | setItemChecked(IDC_DENY, true); | ||||
setItemString(IDC_HOST_PATTERN, &pattern.buf[1]); | setItemString(IDC_HOST_PATTERN, &pattern.buf[1]); | ||||
delete [] pattern.buf; | |||||
pattern.buf = 0; | |||||
pattern.replaceBuf(0); | |||||
} | } | ||||
bool onOk() { | bool onOk() { | ||||
delete [] pattern.buf; | |||||
pattern.buf = 0; | |||||
TCharArray host = getItemString(IDC_HOST_PATTERN); | TCharArray host = getItemString(IDC_HOST_PATTERN); | ||||
TCharArray newPat(_tcslen(host.buf)+2); | TCharArray newPat(_tcslen(host.buf)+2); | ||||
if (isItemChecked(IDC_ALLOW)) | if (isItemChecked(IDC_ALLOW)) | ||||
newPat.buf[0] = _T('+'); | newPat.buf[0] = _T('+'); | ||||
else if (isItemChecked(IDC_QUERY)) | |||||
newPat.buf[0] = _T('?'); | |||||
else | else | ||||
newPat.buf[0] = _T('-'); | newPat.buf[0] = _T('-'); | ||||
newPat.buf[1] = 0; | newPat.buf[1] = 0; | ||||
_tcscat(newPat.buf, host.buf); | _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; | return true; | ||||
} | } | ||||
const TCHAR* getPattern() {return pattern.buf;} | const TCHAR* getPattern() {return pattern.buf;} | ||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {} | : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {} | ||||
void initDialog() { | void initDialog() { | ||||
vlog.debug("set IDC_PORT %d", (int)port_number); | 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); | setItemInt(IDC_IDLE_TIMEOUT, rfb::Server::idleTimeout); | ||||
vlog.debug("set IDC_HTTP_PORT %d", (int)http_port); | 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); | setItemChecked(IDC_HTTP_ENABLE, http_port != 0); | ||||
enableItem(IDC_HTTP_PORT, http_port != 0); | enableItem(IDC_HTTP_PORT, http_port != 0); | ||||
setItemChecked(IDC_LOCALHOST, localHost); | setItemChecked(IDC_LOCALHOST, localHost); | ||||
SendMessage(listBox, LB_ADDSTRING, 0, (LPARAM)(const TCHAR*)TStr(first.buf)); | 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) { | bool onCommand(int id, int cmd) { | ||||
switch (id) { | switch (id) { | ||||
case IDC_PORT: | case IDC_PORT: | ||||
if (cmd == EN_CHANGE) { | if (cmd == EN_CHANGE) { | ||||
try { | try { | ||||
if (getItemInt(IDC_PORT) > 100) | |||||
setItemInt(IDC_HTTP_PORT, getItemInt(IDC_PORT)-100); | |||||
setItemInt(IDC_HTTP_PORT, rfbPortToHTTP(getItemInt(IDC_PORT))); | |||||
} catch (...) { | } catch (...) { | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
case IDC_HTTP_ENABLE: | case IDC_HTTP_ENABLE: | ||||
enableItem(IDC_HTTP_PORT, isItemChecked(IDC_HTTP_ENABLE)); | |||||
setChanged(isChanged()); | |||||
return false; | |||||
case IDC_RFB_ENABLE: | |||||
case IDC_LOCALHOST: | 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: | case IDC_HOST_ADD: | ||||
if (hostDialog.showDialog(_T(""))) | if (hostDialog.showDialog(_T(""))) | ||||
return false; | return false; | ||||
} | } | ||||
bool onOk() { | 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("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); | regKey.setString(_T("Hosts"), TCharArray(getHosts()).buf); | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
return strDup(hosts_str.buf); | 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: | protected: | ||||
RegKey regKey; | RegKey regKey; | ||||
ConnHostDialog hostDialog; | ConnHostDialog hostDialog; | ||||
}; | }; | ||||
#endif | |||||
#endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.h> | #include <rfb_win32/Dialog.h> | ||||
#include <rfb_win32/SDisplay.h> | #include <rfb_win32/SDisplay.h> | ||||
#include <rfb_win32/DynamicFn.h> | |||||
namespace rfb { | namespace rfb { | ||||
}; | }; | ||||
#endif | |||||
#endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.h> | #include <rfb_win32/Dialog.h> | ||||
#include <rfb_win32/SDisplay.h> | #include <rfb_win32/SDisplay.h> | ||||
#include <rfb_win32/WMPoller.h> | |||||
#include <rfb/ServerCore.h> | #include <rfb/ServerCore.h> | ||||
namespace rfb { | namespace rfb { | ||||
HookingPage(const RegKey& rk) | HookingPage(const RegKey& rk) | ||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} | : PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {} | ||||
void initDialog() { | 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_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) { | bool onCommand(int id, int cmd) { | ||||
switch (id) { | switch (id) { | ||||
case IDC_USEPOLLING: | |||||
case IDC_USEHOOKS: | case IDC_USEHOOKS: | ||||
case IDC_USEDRIVER: | |||||
case IDC_POLLCONSOLES: | 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::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; | break; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
bool onOk() { | 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("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; | return true; | ||||
} | } | ||||
protected: | protected: | ||||
}; | }; | ||||
#endif | |||||
#endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.h> | #include <rfb_win32/Dialog.h> | ||||
#include <rfb_win32/OSVersion.h> | |||||
#include <rfb/ServerCore.h> | #include <rfb/ServerCore.h> | ||||
namespace rfb { | namespace rfb { | ||||
namespace win32 { | namespace win32 { | ||||
class InputsPage : public PropSheetPage { | class InputsPage : public PropSheetPage { | ||||
setItemChecked(IDC_ACCEPT_CUTTEXT, rfb::Server::acceptCutText); | setItemChecked(IDC_ACCEPT_CUTTEXT, rfb::Server::acceptCutText); | ||||
setItemChecked(IDC_SEND_CUTTEXT, rfb::Server::sendCutText); | setItemChecked(IDC_SEND_CUTTEXT, rfb::Server::sendCutText); | ||||
setItemChecked(IDC_DISABLE_LOCAL_INPUTS, SDisplay::disableLocalInputs); | setItemChecked(IDC_DISABLE_LOCAL_INPUTS, SDisplay::disableLocalInputs); | ||||
enableItem(IDC_DISABLE_LOCAL_INPUTS, !osVersion.isPlatformWindows); | |||||
BOOL blocked = FALSE; | BOOL blocked = FALSE; | ||||
if (SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &blocked, 0)) | if (SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &blocked, 0)) | ||||
setItemChecked(IDC_AFFECT_SCREENSAVER, !blocked); | setItemChecked(IDC_AFFECT_SCREENSAVER, !blocked); | ||||
}; | }; | ||||
}; | }; | ||||
}; | }; | ||||
#endif | |||||
#endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#include <vncconfig/Legacy.h> | #include <vncconfig/Legacy.h> | ||||
#include <rfb/LogWriter.h> | #include <rfb/LogWriter.h> | ||||
#include <rfb/Password.h> | |||||
#include <rfb_win32/CurrentUser.h> | #include <rfb_win32/CurrentUser.h> | ||||
using namespace rfb; | using namespace rfb; | ||||
} | } | ||||
regKey.setInt(_T("QueryTimeout"), key.getInt(_T("QueryTimeout"), 10)); | 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); | bool enableInputs = key.getBool(_T("InputsEnabled"), true); | ||||
regKey.setBool(_T("AcceptKeyEvents"), enableInputs); | regKey.setBool(_T("AcceptKeyEvents"), enableInputs); |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
#ifndef WINVNCCONF_LEGACY | #ifndef WINVNCCONF_LEGACY | ||||
#define WINVNCCONF_LEGACY | #define WINVNCCONF_LEGACY | ||||
#define WIN32_LEAN_AND_MEAN | |||||
#include <windows.h> | #include <windows.h> | ||||
#include <lmcons.h> | #include <lmcons.h> | ||||
#include <vncconfig/resource.h> | #include <vncconfig/resource.h> | ||||
#include <rfb_win32/Registry.h> | #include <rfb_win32/Registry.h> | ||||
#include <rfb_win32/Dialog.h> | #include <rfb_win32/Dialog.h> | ||||
#include <rfb_win32/Win32Util.h> | |||||
#include <rfb_win32/MsgBox.h> | |||||
#include <rfb/ServerCore.h> | #include <rfb/ServerCore.h> | ||||
#include <rfb/secTypes.h> | |||||
namespace rfb { | namespace rfb { | ||||
}; | }; | ||||
#endif | |||||
#endif |
/* 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; | |||||
} |
/* 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 |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
}; | }; | ||||
#endif | |||||
#endif |
#define IDC_HOST_UP 1019 | #define IDC_HOST_UP 1019 | ||||
#define IDC_BUTTON4 1020 | #define IDC_BUTTON4 1020 | ||||
#define IDC_HOST_DOWN 1020 | #define IDC_HOST_DOWN 1020 | ||||
#define IDC_AUTH_INPUTONLY_PASSWD 1020 | |||||
#define IDC_HOST_EDIT 1021 | #define IDC_HOST_EDIT 1021 | ||||
#define IDC_PASSWORD2 1022 | #define IDC_PASSWORD2 1022 | ||||
#define IDC_LEGACY_IMPORT 1023 | #define IDC_LEGACY_IMPORT 1023 | ||||
#define IDC_COPYRIGHT 1042 | #define IDC_COPYRIGHT 1042 | ||||
#define IDC_HTTP_ENABLE 1043 | #define IDC_HTTP_ENABLE 1043 | ||||
#define IDC_HTTP_PORT 1044 | #define IDC_HTTP_PORT 1044 | ||||
#define A 1045 | |||||
#define IDC_BL_THRESHOLD 1046 | #define IDC_BL_THRESHOLD 1046 | ||||
#define IDC_BL_TIMEOUT 1047 | #define IDC_BL_TIMEOUT 1047 | ||||
#define IDC_AFFECT_SCREENSAVER 1048 | #define IDC_AFFECT_SCREENSAVER 1048 | ||||
#define IDC_LOCALHOST 1049 | #define IDC_LOCALHOST 1049 | ||||
#define IDC_DISABLE_LOCAL_INPUTS 1050 | #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_NONE 1056 | ||||
#define IDC_DISCONNECT_LOCK 1057 | #define IDC_DISCONNECT_LOCK 1057 | ||||
#define IDC_DISCONNECT_LOGOFF 1058 | #define IDC_DISCONNECT_LOGOFF 1058 | ||||
#define IDC_REMOVE_WALLPAPER 1059 | #define IDC_REMOVE_WALLPAPER 1059 | ||||
#define IDC_REMOVE_PATTERN 1060 | #define IDC_REMOVE_PATTERN 1060 | ||||
#define IDC_DISABLE_EFFECTS 1061 | #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_OPTIONS 40001 | ||||
#define ID_CLOSE 40002 | #define ID_CLOSE 40002 | ||||
#define ID_ABOUT 40003 | #define ID_ABOUT 40003 | ||||
#ifndef APSTUDIO_READONLY_SYMBOLS | #ifndef APSTUDIO_READONLY_SYMBOLS | ||||
#define _APS_NEXT_RESOURCE_VALUE 117 | #define _APS_NEXT_RESOURCE_VALUE 117 | ||||
#define _APS_NEXT_COMMAND_VALUE 40004 | #define _APS_NEXT_COMMAND_VALUE 40004 | ||||
#define _APS_NEXT_CONTROL_VALUE 1062 | |||||
#define _APS_NEXT_CONTROL_VALUE 1083 | |||||
#define _APS_NEXT_SYMED_VALUE 101 | #define _APS_NEXT_SYMED_VALUE 101 | ||||
#endif | #endif | ||||
#endif | #endif |
/* 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 | * This is free software; you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | ||||
* USA. | * USA. | ||||
*/ | */ | ||||
#define WIN32_LEAN_AND_MEAN | |||||
#include <windows.h> | #include <windows.h> | ||||
#include <commctrl.h> | #include <commctrl.h> | ||||
#include <string.h> | #include <string.h> | ||||
TStr rfb::win32::AppName("VNC Config"); | TStr rfb::win32::AppName("VNC Config"); | ||||
VncAuthPasswdConfigParameter vncAuthPasswd; | |||||
#ifdef _DEBUG | #ifdef _DEBUG | ||||
BoolParameter captureDialogs("CaptureDialogs", "", false); | BoolParameter captureDialogs("CaptureDialogs", "", false); | ||||
#endif | #endif | ||||
bool warnOnChangePassword = false; | bool warnOnChangePassword = false; | ||||
try { | try { | ||||
AccessEntries access; | 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(adminSID, KEY_ALL_ACCESS, GRANT_ACCESS); | ||||
access.addEntry(systemSID, KEY_ALL_ACCESS, GRANT_ACCESS); | access.addEntry(systemSID, KEY_ALL_ACCESS, GRANT_ACCESS); | ||||
UserName user; | |||||
UserSID userSID; | |||||
if (configKey == HKEY_CURRENT_USER) | 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 | // Set the DACL, and don't allow the key to inherit its parent's DACL | ||||
rootKey.setDACL(acl, false); | rootKey.setDACL(acl, false); | ||||
warnOnChangePassword = true; | 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 | // Build the dialog | ||||
std::list<PropSheetPage*> pages; | std::list<PropSheetPage*> pages; | ||||
#else | #else | ||||
sheet.showPropSheet(0, true, false); | sheet.showPropSheet(0, true, false); | ||||
#endif | #endif | ||||
return 0; | |||||
} catch (rdr::SystemException& e) { | } catch (rdr::SystemException& e) { | ||||
switch (e.err) { | switch (e.err) { | ||||
case ERROR_ACCESS_DENIED: | case ERROR_ACCESS_DENIED: | ||||
}; | }; | ||||
throw; | throw; | ||||
} | } | ||||
} catch (rdr::Exception& e) { | } catch (rdr::Exception& e) { | ||||
MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK); | MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK); | ||||
return 1; | return 1; | ||||
} | } | ||||
return 0; | |||||
} | } |
# End Source File | # End Source File | ||||
# Begin Source File | # Begin Source File | ||||
SOURCE=.\PasswordDialog.cxx | |||||
# End Source File | |||||
# Begin Source File | |||||
SOURCE=.\vncconfig.cxx | SOURCE=.\vncconfig.cxx | ||||
# End Source File | # End Source File | ||||
# End Group | # End Group | ||||
# End Source File | # End Source File | ||||
# Begin Source File | # Begin Source File | ||||
SOURCE=.\PasswordDialog.h | |||||
# End Source File | |||||
# Begin Source File | |||||
SOURCE=.\resource.h | SOURCE=.\resource.h | ||||
# End Source File | # End Source File | ||||
# Begin Source File | # Begin Source File |
// Dialog | // 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 | STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
CAPTION "Authentication" | CAPTION "Authentication" | ||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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, | 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 | END | ||||
IDD_CONNECTIONS DIALOG DISCARDABLE 0, 0, 218, 198 | IDD_CONNECTIONS DIALOG DISCARDABLE 0, 0, 218, 198 | ||||
CAPTION "Connections" | CAPTION "Connections" | ||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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, | LTEXT "Disconnect idle clients after (seconds):",IDC_STATIC,7, | ||||
25,138,15,SS_CENTERIMAGE | 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 | EDITTEXT IDC_IDLE_TIMEOUT,150,25,61,15,ES_AUTOHSCROLL | ES_NUMBER | ||||
CONTROL "Serve Java viewer via HTTP on port:",IDC_HTTP_ENABLE, | CONTROL "Serve Java viewer via HTTP on port:",IDC_HTTP_ENABLE, | ||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,138,15 | "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,138,15 | ||||
PUSHBUTTON "&Edit",IDC_HOST_EDIT,150,170,55,15 | PUSHBUTTON "&Edit",IDC_HOST_EDIT,150,170,55,15 | ||||
END | 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 | STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||
CAPTION "Hooks" | |||||
CAPTION "Capture Method" | |||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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, | 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 | END | ||||
IDD_AUTH_VNC_PASSWD DIALOG DISCARDABLE 0, 0, 212, 70 | IDD_AUTH_VNC_PASSWD DIALOG DISCARDABLE 0, 0, 212, 70 | ||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION | | ||||
WS_SYSMENU | WS_SYSMENU | ||||
CAPTION "WinVNC Password" | |||||
CAPTION "VNC Server Password" | |||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | BEGIN | ||||
LTEXT "New Password:",IDC_STATIC,7,10,63,15 | |||||
EDITTEXT IDC_PASSWORD1,75,10,130,15,ES_PASSWORD | ES_AUTOHSCROLL | 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 | 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 | DEFPUSHBUTTON "OK",IDOK,100,50,50,15 | ||||
PUSHBUTTON "Cancel",IDCANCEL,155,50,50,15 | PUSHBUTTON "Cancel",IDCANCEL,155,50,50,15 | ||||
LTEXT "Confirm Password:",IDC_STATIC,7,30,63,14 | |||||
END | END | ||||
IDD_LEGACY DIALOG DISCARDABLE 0, 0, 166, 92 | IDD_LEGACY DIALOG DISCARDABLE 0, 0, 166, 92 | ||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,35,152,15 | BS_AUTOCHECKBOX | WS_TABSTOP,7,35,152,15 | ||||
END | 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 | STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | ||||
CAPTION "Specify Host IP Address Pattern" | CAPTION "Specify Host IP Address Pattern" | ||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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 | | 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 | END | ||||
IDD_SHARING DIALOG DISCARDABLE 0, 0, 186, 95 | IDD_SHARING DIALOG DISCARDABLE 0, 0, 186, 95 | ||||
CAPTION "Inputs" | CAPTION "Inputs" | ||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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, | CONTROL "Accept pointer events from clients",IDC_ACCEPT_PTR, | ||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,10,172,15 | "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", | CONTROL "Accept clipboard updates from clients", | ||||
IDC_ACCEPT_CUTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, | IDC_ACCEPT_CUTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, | ||||
7,40,172,15 | 7,40,172,15 | ||||
CAPTION "Desktop" | CAPTION "Desktop" | ||||
FONT 8, "MS Sans Serif" | FONT 8, "MS Sans Serif" | ||||
BEGIN | 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 | GROUPBOX "While connected",IDC_STATIC,7,5,171,60 | ||||
CONTROL "Remove wallpaper",IDC_REMOVE_WALLPAPER,"Button", | CONTROL "Remove wallpaper",IDC_REMOVE_WALLPAPER,"Button", | ||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,15,155,15 | BS_AUTOCHECKBOX | WS_TABSTOP,15,15,155,15 | ||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,30,155,15 | BS_AUTOCHECKBOX | WS_TABSTOP,15,30,155,15 | ||||
CONTROL "Disable user interface effects",IDC_DISABLE_EFFECTS, | CONTROL "Disable user interface effects",IDC_DISABLE_EFFECTS, | ||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,46,155,14 | "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 | END | ||||
IDD_AUTHENTICATION, DIALOG | IDD_AUTHENTICATION, DIALOG | ||||
BEGIN | BEGIN | ||||
LEFTMARGIN, 7 | LEFTMARGIN, 7 | ||||
RIGHTMARGIN, 218 | |||||
VERTGUIDE, 150 | |||||
VERTGUIDE, 155 | |||||
VERTGUIDE, 210 | |||||
RIGHTMARGIN, 186 | |||||
VERTGUIDE, 20 | |||||
VERTGUIDE, 49 | |||||
VERTGUIDE, 120 | |||||
VERTGUIDE, 125 | |||||
TOPMARGIN, 7 | TOPMARGIN, 7 | ||||
BOTTOMMARGIN, 79 | |||||
BOTTOMMARGIN, 128 | |||||
HORZGUIDE, 10 | HORZGUIDE, 10 | ||||
HORZGUIDE, 25 | HORZGUIDE, 25 | ||||
HORZGUIDE, 30 | HORZGUIDE, 30 | ||||
HORZGUIDE, 45 | HORZGUIDE, 45 | ||||
HORZGUIDE, 50 | HORZGUIDE, 50 | ||||
HORZGUIDE, 65 | HORZGUIDE, 65 | ||||
HORZGUIDE, 70 | |||||
HORZGUIDE, 85 | |||||
HORZGUIDE, 90 | |||||
HORZGUIDE, 105 | |||||
HORZGUIDE, 110 | |||||
HORZGUIDE, 125 | |||||
END | END | ||||
IDD_CONNECTIONS, DIALOG | IDD_CONNECTIONS, DIALOG | ||||
IDD_HOOKING, DIALOG | IDD_HOOKING, DIALOG | ||||
BEGIN | BEGIN | ||||
LEFTMARGIN, 7 | LEFTMARGIN, 7 | ||||
RIGHTMARGIN, 191 | |||||
RIGHTMARGIN, 190 | |||||
VERTGUIDE, 25 | |||||
TOPMARGIN, 7 | TOPMARGIN, 7 | ||||
BOTTOMMARGIN, 88 | |||||
BOTTOMMARGIN, 94 | |||||
HORZGUIDE, 10 | HORZGUIDE, 10 | ||||
HORZGUIDE, 25 | HORZGUIDE, 25 | ||||
HORZGUIDE, 40 | HORZGUIDE, 40 | ||||
HORZGUIDE, 55 | HORZGUIDE, 55 | ||||
HORZGUIDE, 70 | |||||
HORZGUIDE, 85 | |||||
END | END | ||||
IDD_AUTH_VNC_PASSWD, DIALOG | IDD_AUTH_VNC_PASSWD, DIALOG | ||||
RIGHTMARGIN, 205 | RIGHTMARGIN, 205 | ||||
VERTGUIDE, 70 | VERTGUIDE, 70 | ||||
VERTGUIDE, 75 | VERTGUIDE, 75 | ||||
VERTGUIDE, 90 | |||||
VERTGUIDE, 100 | VERTGUIDE, 100 | ||||
VERTGUIDE, 150 | VERTGUIDE, 150 | ||||
VERTGUIDE, 155 | VERTGUIDE, 155 | ||||
IDD_CONN_HOST, DIALOG | IDD_CONN_HOST, DIALOG | ||||
BEGIN | BEGIN | ||||
LEFTMARGIN, 7 | LEFTMARGIN, 7 | ||||
RIGHTMARGIN, 218 | |||||
RIGHTMARGIN, 220 | |||||
VERTGUIDE, 60 | VERTGUIDE, 60 | ||||
VERTGUIDE, 65 | VERTGUIDE, 65 | ||||
VERTGUIDE, 115 | |||||
VERTGUIDE, 165 | VERTGUIDE, 165 | ||||
TOPMARGIN, 7 | |||||
BOTTOMMARGIN, 40 | |||||
VERTGUIDE, 170 | |||||
TOPMARGIN, 5 | |||||
BOTTOMMARGIN, 50 | |||||
HORZGUIDE, 20 | |||||
HORZGUIDE, 35 | |||||
END | END | ||||
IDD_SHARING, DIALOG | IDD_SHARING, DIALOG | ||||
IDD_DESKTOP, DIALOG | IDD_DESKTOP, DIALOG | ||||
BEGIN | BEGIN | ||||
LEFTMARGIN, 7 | 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 | ||||
END | END | ||||
#endif // APSTUDIO_INVOKED | #endif // APSTUDIO_INVOKED | ||||
// | // | ||||
VS_VERSION_INFO VERSIONINFO | 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 | FILEFLAGSMASK 0x3fL | ||||
#ifdef _DEBUG | #ifdef _DEBUG | ||||
FILEFLAGS 0x1L | FILEFLAGS 0x1L | ||||
BEGIN | BEGIN | ||||
VALUE "Comments", "\0" | VALUE "Comments", "\0" | ||||
VALUE "CompanyName", "Constantin Kaplinsky\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 "LegalTrademarks", "TightVNC\0" | ||||
VALUE "OriginalFilename", "vncconfig.exe\0" | VALUE "OriginalFilename", "vncconfig.exe\0" | ||||
VALUE "PrivateBuild", "\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" | VALUE "SpecialBuild", "\0" | ||||
END | END | ||||
END | END |