Initial commit
This commit is contained in:
189
win/vncconfig/Authentication.h
Normal file
189
win/vncconfig/Authentication.h
Normal file
@@ -0,0 +1,189 @@
|
||||
/* 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
|
||||
* (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_AUTHENTICATION
|
||||
#define WINVNCCONF_AUTHENTICATION
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include <vncconfig/PasswordDialog.h>
|
||||
#include <rfb_win32/Registry.h>
|
||||
#include <rfb_win32/SecurityPage.h>
|
||||
#include <rfb_win32/MsgBox.h>
|
||||
#include <rfb/ServerCore.h>
|
||||
#include <rfb/Security.h>
|
||||
#include <rfb/SecurityServer.h>
|
||||
#include <rfb/SSecurityVncAuth.h>
|
||||
#ifdef HAVE_GNUTLS
|
||||
#include <rfb/SSecurityTLS.h>
|
||||
#endif
|
||||
#include <rfb/Password.h>
|
||||
|
||||
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 SecPage : public SecurityPage {
|
||||
public:
|
||||
SecPage(const RegKey& rk)
|
||||
: SecurityPage(NULL), regKey(rk) {
|
||||
security = new SecurityServer();
|
||||
}
|
||||
|
||||
void initDialog() {
|
||||
SecurityPage::initDialog();
|
||||
|
||||
setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect);
|
||||
setItemChecked(IDC_QUERY_LOGGED_ON, queryOnlyIfLoggedOn);
|
||||
onCommand(IDC_AUTH_NONE, 0);
|
||||
}
|
||||
|
||||
bool onCommand(int id, int cmd) {
|
||||
SecurityPage::onCommand(id, cmd);
|
||||
|
||||
setChanged(true);
|
||||
|
||||
if (id == IDC_AUTH_VNC_PASSWD) {
|
||||
PasswordDialog passwdDlg(regKey, registryInsecure);
|
||||
passwdDlg.showDialog(handle);
|
||||
} else if (id == IDC_LOAD_CERT) {
|
||||
const TCHAR* title = _T("X509Cert");
|
||||
const TCHAR* filter =
|
||||
_T("X.509 Certificates (*.crt;*.cer;*.pem)\0*.crt;*.cer;*.pem\0All\0*.*\0");
|
||||
showFileChooser(regKey, title, filter, handle);
|
||||
} else if (id == IDC_LOAD_CERTKEY) {
|
||||
const TCHAR* title = _T("X509Key");
|
||||
const TCHAR* filter = _T("X.509 Keys (*.key;*.pem)\0*.key;*.pem\0All\0*.*\0");
|
||||
showFileChooser(regKey, title, filter, handle);
|
||||
} else if (id == IDC_QUERY_LOGGED_ON) {
|
||||
enableItem(IDC_QUERY_LOGGED_ON, enableQueryOnlyIfLoggedOn());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
bool onOk() {
|
||||
SecurityPage::onOk();
|
||||
|
||||
if (isItemChecked(IDC_AUTH_VNC))
|
||||
verifyVncPassword(regKey);
|
||||
else if (haveVncPassword() &&
|
||||
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);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
if (isItemChecked(IDC_ENC_X509)) {
|
||||
SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Cert"));
|
||||
SSecurityTLS::X509_CertFile.setParam(regKey.getString("X509Key"));
|
||||
}
|
||||
#endif
|
||||
|
||||
regKey.setString(_T("SecurityTypes"), security->ToString());
|
||||
regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT));
|
||||
regKey.setBool(_T("QueryOnlyIfLoggedOn"), isItemChecked(IDC_QUERY_LOGGED_ON));
|
||||
|
||||
return true;
|
||||
}
|
||||
void setWarnPasswdInsecure(bool warn) {
|
||||
registryInsecure = warn;
|
||||
}
|
||||
bool enableQueryOnlyIfLoggedOn() {
|
||||
return isItemChecked(IDC_QUERY_CONNECT);
|
||||
}
|
||||
|
||||
|
||||
static bool haveVncPassword() {
|
||||
PlainPasswd password, passwordReadOnly;
|
||||
SSecurityVncAuth::vncAuthPasswd.getVncAuthPasswd(&password, &passwordReadOnly);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void loadX509Certs(void) {}
|
||||
virtual void enableX509Dialogs(void) {
|
||||
enableItem(IDC_LOAD_CERT, true);
|
||||
enableItem(IDC_LOAD_CERTKEY, true);
|
||||
}
|
||||
virtual void disableX509Dialogs(void) {
|
||||
enableItem(IDC_LOAD_CERT, false);
|
||||
enableItem(IDC_LOAD_CERTKEY, false);
|
||||
}
|
||||
virtual void loadVncPasswd() {
|
||||
enableItem(IDC_AUTH_VNC_PASSWD, isItemChecked(IDC_AUTH_VNC));
|
||||
}
|
||||
|
||||
protected:
|
||||
RegKey regKey;
|
||||
static bool registryInsecure;
|
||||
private:
|
||||
inline void modifyAuthMethod(int enc_idc, int auth_idc, bool enable)
|
||||
{
|
||||
setItemChecked(enc_idc, enable);
|
||||
setItemChecked(auth_idc, enable);
|
||||
}
|
||||
inline bool showFileChooser(const RegKey& rk,
|
||||
const char* title,
|
||||
const char* filter,
|
||||
HWND hwnd)
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
char filename[MAX_PATH];
|
||||
|
||||
ZeroMemory(&ofn, sizeof(ofn));
|
||||
ZeroMemory(&filename, sizeof(filename));
|
||||
filename[0] = '\0';
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = hwnd;
|
||||
ofn.lpstrFile = filename;
|
||||
ofn.nMaxFile = sizeof(filename);
|
||||
ofn.lpstrFilter = (char*)filter;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.nMaxFileTitle = 0;
|
||||
ofn.lpstrTitle = (char*)title;
|
||||
ofn.lpstrInitialDir = NULL;
|
||||
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
|
||||
if (GetOpenFileName(&ofn)==TRUE) {
|
||||
regKey.setString(title, filename);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
bool SecPage::registryInsecure = false;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
13
win/vncconfig/CMakeLists.txt
Normal file
13
win/vncconfig/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
include_directories(${CMAKE_BINARY_DIR}/win)
|
||||
|
||||
add_executable(vncconfig WIN32
|
||||
Legacy.cxx
|
||||
PasswordDialog.cxx
|
||||
vncconfig.cxx
|
||||
vncconfig.rc)
|
||||
|
||||
target_link_libraries(vncconfig rfb_win32 rfb network rdr ws2_32.lib)
|
||||
|
||||
install(TARGETS vncconfig
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
)
|
||||
303
win/vncconfig/Connections.h
Normal file
303
win/vncconfig/Connections.h
Normal file
@@ -0,0 +1,303 @@
|
||||
/* 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
|
||||
* (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_CONNECTIONS
|
||||
#define WINVNCCONF_CONNECTIONS
|
||||
|
||||
#include <vector>
|
||||
|
||||
#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>
|
||||
|
||||
static rfb::IntParameter http_port("HTTPPortNumber",
|
||||
"TCP/IP port on which the server will serve the Java applet VNC Viewer ", 5800);
|
||||
static rfb::IntParameter port_number("PortNumber",
|
||||
"TCP/IP port on which the server will accept connections", 5900);
|
||||
static rfb::StringParameter hosts("Hosts",
|
||||
"Filter describing which hosts are allowed access to this server", "+");
|
||||
static rfb::BoolParameter localHost("LocalHost",
|
||||
"Only accept connections from via the local loop-back network interface", false);
|
||||
|
||||
namespace rfb {
|
||||
|
||||
namespace win32 {
|
||||
|
||||
class ConnHostDialog : public Dialog {
|
||||
public:
|
||||
ConnHostDialog() : Dialog(GetModuleHandle(0)) {}
|
||||
bool showDialog(const TCHAR* pat) {
|
||||
pattern.replaceBuf(tstrDup(pat));
|
||||
return Dialog::showDialog(MAKEINTRESOURCE(IDD_CONN_HOST));
|
||||
}
|
||||
void initDialog() {
|
||||
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]);
|
||||
pattern.replaceBuf(0);
|
||||
}
|
||||
bool onOk() {
|
||||
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);
|
||||
|
||||
try {
|
||||
network::TcpFilter::Pattern pat(network::TcpFilter::parsePattern(CStr(newPat.buf)));
|
||||
pattern.replaceBuf(TCharArray(network::TcpFilter::patternToStr(pat)).takeBuf());
|
||||
} catch(rdr::Exception& e) {
|
||||
MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const TCHAR* getPattern() {return pattern.buf;}
|
||||
protected:
|
||||
TCharArray pattern;
|
||||
};
|
||||
|
||||
class ConnectionsPage : public PropSheetPage {
|
||||
public:
|
||||
ConnectionsPage(const RegKey& rk)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_CONNECTIONS)), regKey(rk) {}
|
||||
void initDialog() {
|
||||
vlog.debug("set IDC_PORT %d", (int)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 ? http_port : 5800);
|
||||
setItemChecked(IDC_HTTP_ENABLE, http_port != 0);
|
||||
enableItem(IDC_HTTP_PORT, http_port != 0);
|
||||
setItemChecked(IDC_LOCALHOST, localHost);
|
||||
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
while (SendMessage(listBox, LB_GETCOUNT, 0, 0))
|
||||
SendMessage(listBox, LB_DELETESTRING, 0, 0);
|
||||
|
||||
CharArray tmp;
|
||||
tmp.buf = hosts.getData();
|
||||
while (tmp.buf) {
|
||||
CharArray first;
|
||||
strSplit(tmp.buf, ',', &first.buf, &tmp.buf);
|
||||
if (strlen(first.buf))
|
||||
SendMessage(listBox, LB_ADDSTRING, 0, (LPARAM)(const TCHAR*)TStr(first.buf));
|
||||
}
|
||||
|
||||
onCommand(IDC_RFB_ENABLE, EN_CHANGE);
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
switch (id) {
|
||||
case IDC_HOSTS:
|
||||
{
|
||||
DWORD selected = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCURSEL, 0, 0);
|
||||
DWORD count = SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_GETCOUNT, 0, 0);
|
||||
bool enable = selected != (DWORD)LB_ERR;
|
||||
enableItem(IDC_HOST_REMOVE, enable);
|
||||
enableItem(IDC_HOST_UP, enable && (selected > 0));
|
||||
enableItem(IDC_HOST_DOWN, enable && (selected+1 < count));
|
||||
enableItem(IDC_HOST_EDIT, enable);
|
||||
setChanged(isChanged());
|
||||
}
|
||||
return true;
|
||||
|
||||
case IDC_PORT:
|
||||
if (cmd == EN_CHANGE) {
|
||||
try {
|
||||
setItemInt(IDC_HTTP_PORT, rfbPortToHTTP(getItemInt(IDC_PORT)));
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
case IDC_HTTP_PORT:
|
||||
case IDC_IDLE_TIMEOUT:
|
||||
if (cmd == EN_CHANGE)
|
||||
setChanged(isChanged());
|
||||
return false;
|
||||
|
||||
case IDC_HTTP_ENABLE:
|
||||
case IDC_RFB_ENABLE:
|
||||
case IDC_LOCALHOST:
|
||||
{
|
||||
// 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("")))
|
||||
{
|
||||
const TCHAR* pattern = hostDialog.getPattern();
|
||||
if (pattern)
|
||||
SendMessage(GetDlgItem(handle, IDC_HOSTS), LB_ADDSTRING, 0, (LPARAM)pattern);
|
||||
}
|
||||
return true;
|
||||
|
||||
case IDC_HOST_EDIT:
|
||||
{
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
int item = SendMessage(listBox, LB_GETCURSEL, 0, 0);
|
||||
TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1);
|
||||
SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf);
|
||||
|
||||
if (hostDialog.showDialog(pattern.buf)) {
|
||||
const TCHAR* newPat = hostDialog.getPattern();
|
||||
if (newPat) {
|
||||
item = SendMessage(listBox, LB_FINDSTRINGEXACT, item, (LPARAM)pattern.buf);
|
||||
if (item != LB_ERR) {
|
||||
SendMessage(listBox, LB_DELETESTRING, item, 0);
|
||||
SendMessage(listBox, LB_INSERTSTRING, item, (LPARAM)newPat);
|
||||
SendMessage(listBox, LB_SETCURSEL, item, 0);
|
||||
onCommand(IDC_HOSTS, EN_CHANGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
case IDC_HOST_UP:
|
||||
{
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
int item = SendMessage(listBox, LB_GETCURSEL, 0, 0);
|
||||
TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1);
|
||||
SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf);
|
||||
SendMessage(listBox, LB_DELETESTRING, item, 0);
|
||||
SendMessage(listBox, LB_INSERTSTRING, item-1, (LPARAM)pattern.buf);
|
||||
SendMessage(listBox, LB_SETCURSEL, item-1, 0);
|
||||
onCommand(IDC_HOSTS, EN_CHANGE);
|
||||
}
|
||||
return true;
|
||||
|
||||
case IDC_HOST_DOWN:
|
||||
{
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
int item = SendMessage(listBox, LB_GETCURSEL, 0, 0);
|
||||
TCharArray pattern(SendMessage(listBox, LB_GETTEXTLEN, item, 0)+1);
|
||||
SendMessage(listBox, LB_GETTEXT, item, (LPARAM)pattern.buf);
|
||||
SendMessage(listBox, LB_DELETESTRING, item, 0);
|
||||
SendMessage(listBox, LB_INSERTSTRING, item+1, (LPARAM)pattern.buf);
|
||||
SendMessage(listBox, LB_SETCURSEL, item+1, 0);
|
||||
onCommand(IDC_HOSTS, EN_CHANGE);
|
||||
}
|
||||
return true;
|
||||
|
||||
case IDC_HOST_REMOVE:
|
||||
{
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
int item = SendMessage(listBox, LB_GETCURSEL, 0, 0);
|
||||
SendMessage(listBox, LB_DELETESTRING, item, 0);
|
||||
onCommand(IDC_HOSTS, EN_CHANGE);
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool onOk() {
|
||||
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) && 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;
|
||||
}
|
||||
bool isChanged() {
|
||||
try {
|
||||
CharArray new_hosts(getHosts());
|
||||
CharArray old_hosts(hosts.getData());
|
||||
return (strcmp(new_hosts.buf, old_hosts.buf) != 0) ||
|
||||
(localHost != isItemChecked(IDC_LOCALHOST)) ||
|
||||
(port_number != getItemInt(IDC_PORT)) ||
|
||||
(http_port != getItemInt(IDC_HTTP_PORT)) ||
|
||||
((http_port!=0) != (isItemChecked(IDC_HTTP_ENABLE)!=0)) ||
|
||||
(rfb::Server::idleTimeout != getItemInt(IDC_IDLE_TIMEOUT));
|
||||
} catch (rdr::Exception&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
char* getHosts() {
|
||||
int bufLen = 1, i;
|
||||
HWND listBox = GetDlgItem(handle, IDC_HOSTS);
|
||||
for (i=0; i<SendMessage(listBox, LB_GETCOUNT, 0, 0); i++)
|
||||
bufLen+=SendMessage(listBox, LB_GETTEXTLEN, i, 0)+1;
|
||||
TCharArray hosts_str(bufLen);
|
||||
hosts_str.buf[0] = 0;
|
||||
TCHAR* outPos = hosts_str.buf;
|
||||
for (i=0; i<SendMessage(listBox, LB_GETCOUNT, 0, 0); i++) {
|
||||
outPos += SendMessage(listBox, LB_GETTEXT, i, (LPARAM)outPos);
|
||||
outPos[0] = ',';
|
||||
outPos[1] = 0;
|
||||
outPos++;
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
80
win/vncconfig/Desktop.h
Normal file
80
win/vncconfig/Desktop.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* 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
|
||||
* (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_DESKTOP
|
||||
#define WINVNCCONF_DESKTOP
|
||||
|
||||
#include <rfb_win32/Registry.h>
|
||||
#include <rfb_win32/Dialog.h>
|
||||
#include <rfb_win32/SDisplay.h>
|
||||
|
||||
namespace rfb {
|
||||
|
||||
namespace win32 {
|
||||
|
||||
class DesktopPage : public PropSheetPage {
|
||||
public:
|
||||
DesktopPage(const RegKey& rk)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_DESKTOP)), regKey(rk) {}
|
||||
void initDialog() {
|
||||
CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
|
||||
bool disconnectLock = stricmp(action.buf, "Lock") == 0;
|
||||
bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
|
||||
setItemChecked(IDC_DISCONNECT_LOGOFF, disconnectLogoff);
|
||||
setItemChecked(IDC_DISCONNECT_LOCK, disconnectLock);
|
||||
setItemChecked(IDC_DISCONNECT_NONE, !disconnectLock && !disconnectLogoff);
|
||||
setItemChecked(IDC_REMOVE_WALLPAPER, rfb::win32::SDisplay::removeWallpaper);
|
||||
setItemChecked(IDC_DISABLE_EFFECTS, rfb::win32::SDisplay::disableEffects);
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
switch (id) {
|
||||
case IDC_DISCONNECT_LOGOFF:
|
||||
case IDC_DISCONNECT_LOCK:
|
||||
case IDC_DISCONNECT_NONE:
|
||||
case IDC_REMOVE_WALLPAPER:
|
||||
case IDC_DISABLE_EFFECTS:
|
||||
CharArray action(rfb::win32::SDisplay::disconnectAction.getData());
|
||||
bool disconnectLock = stricmp(action.buf, "Lock") == 0;
|
||||
bool disconnectLogoff = stricmp(action.buf, "Logoff") == 0;
|
||||
setChanged((disconnectLogoff != isItemChecked(IDC_DISCONNECT_LOGOFF)) ||
|
||||
(disconnectLock != isItemChecked(IDC_DISCONNECT_LOCK)) ||
|
||||
(isItemChecked(IDC_REMOVE_WALLPAPER) != rfb::win32::SDisplay::removeWallpaper) ||
|
||||
(isItemChecked(IDC_DISABLE_EFFECTS) != rfb::win32::SDisplay::disableEffects));
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool onOk() {
|
||||
const TCHAR* action = _T("None");
|
||||
if (isItemChecked(IDC_DISCONNECT_LOGOFF))
|
||||
action = _T("Logoff");
|
||||
else if (isItemChecked(IDC_DISCONNECT_LOCK))
|
||||
action = _T("Lock");
|
||||
regKey.setString(_T("DisconnectAction"), action);
|
||||
regKey.setBool(_T("RemoveWallpaper"), isItemChecked(IDC_REMOVE_WALLPAPER));
|
||||
regKey.setBool(_T("DisableEffects"), isItemChecked(IDC_DISABLE_EFFECTS));
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
RegKey regKey;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
77
win/vncconfig/Hooking.h
Normal file
77
win/vncconfig/Hooking.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/* 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
|
||||
* (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_HOOKING
|
||||
#define WINVNCCONF_HOOKING
|
||||
|
||||
#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 {
|
||||
|
||||
namespace win32 {
|
||||
|
||||
class HookingPage : public PropSheetPage {
|
||||
public:
|
||||
HookingPage(const RegKey& rk)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_HOOKING)), regKey(rk) {}
|
||||
void initDialog() {
|
||||
setItemChecked(IDC_USEPOLLING, rfb::win32::SDisplay::updateMethod == 0);
|
||||
setItemChecked(IDC_USEHOOKS, (rfb::win32::SDisplay::updateMethod == 1));
|
||||
setItemChecked(IDC_POLLCONSOLES, rfb::win32::WMPoller::poll_console_windows);
|
||||
setItemChecked(IDC_CAPTUREBLT, rfb::win32::DeviceFrameBuffer::useCaptureBlt);
|
||||
onCommand(IDC_USEHOOKS, 0);
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
switch (id) {
|
||||
case IDC_USEPOLLING:
|
||||
case IDC_USEHOOKS:
|
||||
case IDC_POLLCONSOLES:
|
||||
case IDC_CAPTUREBLT:
|
||||
setChanged(((rfb::win32::SDisplay::updateMethod == 0) != isItemChecked(IDC_USEPOLLING)) ||
|
||||
((rfb::win32::SDisplay::updateMethod == 1) != isItemChecked(IDC_USEHOOKS)) ||
|
||||
(rfb::win32::WMPoller::poll_console_windows != isItemChecked(IDC_POLLCONSOLES)) ||
|
||||
(rfb::win32::DeviceFrameBuffer::useCaptureBlt != isItemChecked(IDC_CAPTUREBLT)));
|
||||
enableItem(IDC_POLLCONSOLES, isItemChecked(IDC_USEHOOKS));
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool onOk() {
|
||||
if (isItemChecked(IDC_USEPOLLING))
|
||||
regKey.setInt(_T("UpdateMethod"), 0);
|
||||
if (isItemChecked(IDC_USEHOOKS))
|
||||
regKey.setInt(_T("UpdateMethod"), 1);
|
||||
regKey.setBool(_T("PollConsoleWindows"), isItemChecked(IDC_POLLCONSOLES));
|
||||
regKey.setBool(_T("UseCaptureBlt"), isItemChecked(IDC_CAPTUREBLT));
|
||||
|
||||
// *** LEGACY compatibility ***
|
||||
regKey.setBool(_T("UseHooks"), isItemChecked(IDC_USEHOOKS));
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
RegKey regKey;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
85
win/vncconfig/Inputs.h
Normal file
85
win/vncconfig/Inputs.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* 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
|
||||
* (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_INPUTS
|
||||
#define WINVNCCONF_INPUTS
|
||||
|
||||
#ifndef SPI_GETBLOCKSENDINPUTRESETS
|
||||
#define SPI_GETBLOCKSENDINPUTRESETS 0x1026
|
||||
#define SPI_SETBLOCKSENDINPUTRESETS 0x1027
|
||||
#endif
|
||||
|
||||
#include <rfb_win32/Registry.h>
|
||||
#include <rfb_win32/Dialog.h>
|
||||
#include <rfb/ServerCore.h>
|
||||
|
||||
namespace rfb {
|
||||
namespace win32 {
|
||||
|
||||
class InputsPage : public PropSheetPage {
|
||||
public:
|
||||
InputsPage(const RegKey& rk)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_INPUTS)),
|
||||
regKey(rk), enableAffectSSaver(true) {}
|
||||
void initDialog() {
|
||||
setItemChecked(IDC_ACCEPT_KEYS, rfb::Server::acceptKeyEvents);
|
||||
setItemChecked(IDC_RAW_KEYBOARD, SKeyboard::rawKeyboard);
|
||||
setItemChecked(IDC_ACCEPT_PTR, rfb::Server::acceptPointerEvents);
|
||||
setItemChecked(IDC_ACCEPT_CUTTEXT, rfb::Server::acceptCutText);
|
||||
setItemChecked(IDC_SEND_CUTTEXT, rfb::Server::sendCutText);
|
||||
setItemChecked(IDC_DISABLE_LOCAL_INPUTS, SDisplay::disableLocalInputs);
|
||||
BOOL blocked = FALSE;
|
||||
if (SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &blocked, 0))
|
||||
setItemChecked(IDC_AFFECT_SCREENSAVER, !blocked);
|
||||
else
|
||||
enableAffectSSaver = false;
|
||||
enableItem(IDC_AFFECT_SCREENSAVER, enableAffectSSaver);
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
BOOL inputResetsBlocked;
|
||||
SystemParametersInfo(SPI_GETBLOCKSENDINPUTRESETS, 0, &inputResetsBlocked, 0);
|
||||
setChanged((rfb::Server::acceptKeyEvents != isItemChecked(IDC_ACCEPT_KEYS)) ||
|
||||
(SKeyboard::rawKeyboard != isItemChecked(IDC_RAW_KEYBOARD)) ||
|
||||
(rfb::Server::acceptPointerEvents != isItemChecked(IDC_ACCEPT_PTR)) ||
|
||||
(rfb::Server::acceptCutText != isItemChecked(IDC_ACCEPT_CUTTEXT)) ||
|
||||
(rfb::Server::sendCutText != isItemChecked(IDC_SEND_CUTTEXT)) ||
|
||||
(SDisplay::disableLocalInputs != isItemChecked(IDC_DISABLE_LOCAL_INPUTS)) ||
|
||||
(enableAffectSSaver && (!inputResetsBlocked != isItemChecked(IDC_AFFECT_SCREENSAVER))));
|
||||
return false;
|
||||
}
|
||||
bool onOk() {
|
||||
regKey.setBool(_T("AcceptKeyEvents"), isItemChecked(IDC_ACCEPT_KEYS));
|
||||
regKey.setBool(_T("RawKeyboard"), isItemChecked(IDC_RAW_KEYBOARD));
|
||||
regKey.setBool(_T("AcceptPointerEvents"), isItemChecked(IDC_ACCEPT_PTR));
|
||||
regKey.setBool(_T("AcceptCutText"), isItemChecked(IDC_ACCEPT_CUTTEXT));
|
||||
regKey.setBool(_T("SendCutText"), isItemChecked(IDC_SEND_CUTTEXT));
|
||||
regKey.setBool(_T("DisableLocalInputs"), isItemChecked(IDC_DISABLE_LOCAL_INPUTS));
|
||||
if (enableAffectSSaver) {
|
||||
BOOL blocked = !isItemChecked(IDC_AFFECT_SCREENSAVER);
|
||||
SystemParametersInfo(SPI_SETBLOCKSENDINPUTRESETS, blocked, 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
RegKey regKey;
|
||||
bool enableAffectSSaver;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
247
win/vncconfig/Legacy.cxx
Normal file
247
win/vncconfig/Legacy.cxx
Normal file
@@ -0,0 +1,247 @@
|
||||
/* 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
|
||||
* (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/Legacy.h>
|
||||
|
||||
#include <rfb/LogWriter.h>
|
||||
#include <rfb/Password.h>
|
||||
#include <rfb_win32/CurrentUser.h>
|
||||
|
||||
using namespace rfb;
|
||||
using namespace win32;
|
||||
|
||||
static LogWriter vlog("Legacy");
|
||||
|
||||
|
||||
void LegacyPage::LoadPrefs()
|
||||
{
|
||||
// VNC 3.3.3R3 Preferences Algorithm, as described by vncProperties.cpp
|
||||
// - Load user-specific settings, based on logged-on user name,
|
||||
// from HKLM/Software/ORL/WinVNC3/<user>. If they don't exist,
|
||||
// try again with username "Default".
|
||||
// - Load system-wide settings from HKLM/Software/ORL/WinVNC3.
|
||||
// - If AllowProperties is non-zero then load the user's own
|
||||
// settings from HKCU/Software/ORL/WinVNC3.
|
||||
|
||||
// Get the name of the current user
|
||||
TCharArray username;
|
||||
try {
|
||||
UserName name;
|
||||
username.buf = name.takeBuf();
|
||||
} catch (rdr::SystemException& e) {
|
||||
if (e.err != ERROR_NOT_LOGGED_ON)
|
||||
throw;
|
||||
}
|
||||
|
||||
// Open and read the WinVNC3 registry key
|
||||
allowProperties = true;
|
||||
RegKey winvnc3;
|
||||
try {
|
||||
winvnc3.openKey(HKEY_LOCAL_MACHINE, _T("Software\\ORL\\WinVNC3"));
|
||||
int debugMode = winvnc3.getInt(_T("DebugMode"), 0);
|
||||
const char* debugTarget = 0;
|
||||
if (debugMode & 2) debugTarget = "file";
|
||||
if (debugMode & 4) debugTarget = "stderr";
|
||||
if (debugTarget) {
|
||||
char logSetting[32];
|
||||
sprintf(logSetting, "*:%s:%d", debugTarget, winvnc3.getInt(_T("DebugLevel"), 0));
|
||||
regKey.setString(_T("Log"), TStr(logSetting));
|
||||
}
|
||||
|
||||
TCharArray authHosts;
|
||||
authHosts.buf = winvnc3.getString(_T("AuthHosts"), 0);
|
||||
if (authHosts.buf) {
|
||||
CharArray newHosts;
|
||||
newHosts.buf = strDup("");
|
||||
|
||||
// Reformat AuthHosts to Hosts. Wish I'd left the format the same. :( :( :(
|
||||
try {
|
||||
CharArray tmp(authHosts.buf);
|
||||
while (tmp.buf) {
|
||||
|
||||
// Split the AuthHosts string into patterns to match
|
||||
CharArray first;
|
||||
rfb::strSplit(tmp.buf, ':', &first.buf, &tmp.buf);
|
||||
if (strlen(first.buf)) {
|
||||
int bits = 0;
|
||||
CharArray pattern(1+4*4+4);
|
||||
pattern.buf[0] = first.buf[0];
|
||||
pattern.buf[1] = 0;
|
||||
|
||||
// Split the pattern into IP address parts and process
|
||||
rfb::CharArray address;
|
||||
address.buf = rfb::strDup(&first.buf[1]);
|
||||
while (address.buf) {
|
||||
rfb::CharArray part;
|
||||
rfb::strSplit(address.buf, '.', &part.buf, &address.buf);
|
||||
if (bits)
|
||||
strcat(pattern.buf, ".");
|
||||
if (strlen(part.buf) > 3)
|
||||
throw rdr::Exception("Invalid IP address part");
|
||||
if (strlen(part.buf) > 0) {
|
||||
strcat(pattern.buf, part.buf);
|
||||
bits += 8;
|
||||
}
|
||||
}
|
||||
|
||||
// Pad out the address specification if required
|
||||
int addrBits = bits;
|
||||
while (addrBits < 32) {
|
||||
if (addrBits) strcat(pattern.buf, ".");
|
||||
strcat(pattern.buf, "0");
|
||||
addrBits += 8;
|
||||
}
|
||||
|
||||
// Append the number of bits to match
|
||||
char buf[4];
|
||||
sprintf(buf, "/%d", bits);
|
||||
strcat(pattern.buf, buf);
|
||||
|
||||
// Append this pattern to the Hosts value
|
||||
int length = strlen(newHosts.buf) + strlen(pattern.buf) + 2;
|
||||
CharArray tmpHosts(length);
|
||||
strcpy(tmpHosts.buf, pattern.buf);
|
||||
if (strlen(newHosts.buf)) {
|
||||
strcat(tmpHosts.buf, ",");
|
||||
strcat(tmpHosts.buf, newHosts.buf);
|
||||
}
|
||||
delete [] newHosts.buf;
|
||||
newHosts.buf = tmpHosts.takeBuf();
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, save the Hosts value
|
||||
regKey.setString(_T("Hosts"), TStr(newHosts.buf));
|
||||
} catch (rdr::Exception&) {
|
||||
MsgBox(0, _T("Unable to convert AuthHosts setting to Hosts format."),
|
||||
MB_ICONWARNING | MB_OK);
|
||||
}
|
||||
} else {
|
||||
regKey.setString(_T("Hosts"), _T("+"));
|
||||
}
|
||||
|
||||
regKey.setBool(_T("LocalHost"), winvnc3.getBool(_T("LoopbackOnly"), false));
|
||||
// *** check AllowLoopback?
|
||||
|
||||
if (winvnc3.getBool(_T("AuthRequired"), true))
|
||||
regKey.setString(_T("SecurityTypes"), _T("VncAuth"));
|
||||
else
|
||||
regKey.setString(_T("SecurityTypes"), _T("None"));
|
||||
|
||||
int connectPriority = winvnc3.getInt(_T("ConnectPriority"), 0);
|
||||
regKey.setBool(_T("DisconnectClients"), connectPriority == 0);
|
||||
regKey.setBool(_T("AlwaysShared"), connectPriority == 1);
|
||||
regKey.setBool(_T("NeverShared"), connectPriority == 2);
|
||||
|
||||
} catch(rdr::Exception&) {
|
||||
}
|
||||
|
||||
// Open the local, default-user settings
|
||||
allowProperties = true;
|
||||
try {
|
||||
RegKey userKey;
|
||||
userKey.openKey(winvnc3, _T("Default"));
|
||||
vlog.info("loading Default prefs");
|
||||
LoadUserPrefs(userKey);
|
||||
} catch(rdr::Exception& e) {
|
||||
vlog.error("error reading Default settings:%s", e.str());
|
||||
}
|
||||
|
||||
// Open the local, user-specific settings
|
||||
if (userSettings && username.buf) {
|
||||
try {
|
||||
RegKey userKey;
|
||||
userKey.openKey(winvnc3, username.buf);
|
||||
vlog.info("loading local User prefs");
|
||||
LoadUserPrefs(userKey);
|
||||
} catch(rdr::Exception& e) {
|
||||
vlog.error("error reading local User settings:%s", e.str());
|
||||
}
|
||||
|
||||
// Open the user's own settings
|
||||
if (allowProperties) {
|
||||
try {
|
||||
RegKey userKey;
|
||||
userKey.openKey(HKEY_CURRENT_USER, _T("Software\\ORL\\WinVNC3"));
|
||||
vlog.info("loading global User prefs");
|
||||
LoadUserPrefs(userKey);
|
||||
} catch(rdr::Exception& e) {
|
||||
vlog.error("error reading global User settings:%s", e.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable the Options menu item if appropriate
|
||||
regKey.setBool(_T("DisableOptions"), !allowProperties);
|
||||
}
|
||||
|
||||
void LegacyPage::LoadUserPrefs(const RegKey& key)
|
||||
{
|
||||
if (key.getBool(_T("HTTPConnect"), true))
|
||||
regKey.setInt(_T("HTTPPortNumber"), key.getInt(_T("PortNumber"), 5900)-100);
|
||||
else
|
||||
regKey.setInt(_T("HTTPPortNumber"), 0);
|
||||
regKey.setInt(_T("PortNumber"), key.getBool(_T("SocketConnect")) ? key.getInt(_T("PortNumber"), 5900) : 0);
|
||||
if (key.getBool(_T("AutoPortSelect"), false)) {
|
||||
MsgBox(0, _T("The AutoPortSelect setting is not supported by this release.")
|
||||
_T("The port number will default to 5900."),
|
||||
MB_ICONWARNING | MB_OK);
|
||||
regKey.setInt(_T("PortNumber"), 5900);
|
||||
}
|
||||
regKey.setInt(_T("IdleTimeout"), key.getInt(_T("IdleTimeout"), 0));
|
||||
|
||||
regKey.setBool(_T("RemoveWallpaper"), key.getBool(_T("RemoveWallpaper")));
|
||||
regKey.setBool(_T("DisableEffects"), key.getBool(_T("DisableEffects")));
|
||||
|
||||
if (key.getInt(_T("QuerySetting"), 2) != 2) {
|
||||
regKey.setBool(_T("QueryConnect"), key.getInt(_T("QuerySetting")) > 2);
|
||||
MsgBox(0, _T("The QuerySetting option has been replaced by QueryConnect.")
|
||||
_T("Please see the documentation for details of the QueryConnect option."),
|
||||
MB_ICONWARNING | MB_OK);
|
||||
}
|
||||
regKey.setInt(_T("QueryTimeout"), key.getInt(_T("QueryTimeout"), 10));
|
||||
|
||||
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);
|
||||
regKey.setBool(_T("AcceptPointerEvents"), enableInputs);
|
||||
regKey.setBool(_T("AcceptCutText"), enableInputs);
|
||||
regKey.setBool(_T("SendCutText"), enableInputs);
|
||||
|
||||
switch (key.getInt(_T("LockSetting"), 0)) {
|
||||
case 0: regKey.setString(_T("DisconnectAction"), _T("None")); break;
|
||||
case 1: regKey.setString(_T("DisconnectAction"), _T("Lock")); break;
|
||||
case 2: regKey.setString(_T("DisconnectAction"), _T("Logoff")); break;
|
||||
};
|
||||
|
||||
regKey.setBool(_T("DisableLocalInputs"), key.getBool(_T("LocalInputsDisabled"), false));
|
||||
|
||||
// *** ignore polling preferences
|
||||
// PollUnderCursor, PollForeground, OnlyPollConsole, OnlyPollOnEvent
|
||||
regKey.setBool(_T("UseHooks"), !key.getBool(_T("PollFullScreen"), false));
|
||||
|
||||
if (key.isValue(_T("AllowShutdown")))
|
||||
MsgBox(0, _T("The AllowShutdown option is not supported by this release."), MB_ICONWARNING | MB_OK);
|
||||
if (key.isValue(_T("AllowEditClients")))
|
||||
MsgBox(0, _T("The AllowEditClients option is not supported by this release."), MB_ICONWARNING | MB_OK);
|
||||
|
||||
allowProperties = key.getBool(_T("AllowProperties"), allowProperties);
|
||||
}
|
||||
85
win/vncconfig/Legacy.h
Normal file
85
win/vncconfig/Legacy.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* 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
|
||||
* (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_LEGACY
|
||||
#define WINVNCCONF_LEGACY
|
||||
|
||||
#include <windows.h>
|
||||
#include <lmcons.h>
|
||||
#include <vncconfig/resource.h>
|
||||
#include <rfb_win32/Registry.h>
|
||||
#include <rfb_win32/Dialog.h>
|
||||
#include <rfb_win32/MsgBox.h>
|
||||
#include <rfb/ServerCore.h>
|
||||
#include <rfb/Security.h>
|
||||
|
||||
namespace rfb {
|
||||
|
||||
namespace win32 {
|
||||
|
||||
class LegacyPage : public PropSheetPage {
|
||||
public:
|
||||
LegacyPage(const RegKey& rk, bool userSettings_)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_LEGACY)), regKey(rk), userSettings(userSettings_) {}
|
||||
void initDialog() {
|
||||
setItemChecked(IDC_PROTOCOL_3_3, rfb::Server::protocol3_3);
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
switch (id) {
|
||||
case IDC_LEGACY_IMPORT:
|
||||
{
|
||||
DWORD result = MsgBox(0,
|
||||
_T("Importing your legacy VNC 3.3 settings will overwrite your existing settings.\n")
|
||||
_T("Are you sure you wish to continue?"),
|
||||
MB_ICONWARNING | MB_YESNO);
|
||||
if (result == IDYES) {
|
||||
LoadPrefs();
|
||||
MsgBox(0, _T("Imported VNC 3.3 settings successfully."),
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
|
||||
// Sleep to allow RegConfig thread to reload settings
|
||||
Sleep(1000);
|
||||
propSheet->reInitPages();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case IDC_PROTOCOL_3_3:
|
||||
setChanged(isItemChecked(IDC_PROTOCOL_3_3) != rfb::Server::protocol3_3);
|
||||
return false;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
bool onOk() {
|
||||
regKey.setBool(_T("Protocol3.3"), isItemChecked(IDC_PROTOCOL_3_3));
|
||||
return true;
|
||||
}
|
||||
|
||||
void LoadPrefs();
|
||||
void LoadUserPrefs(const RegKey& key);
|
||||
|
||||
protected:
|
||||
bool allowProperties;
|
||||
RegKey regKey;
|
||||
bool userSettings;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
52
win/vncconfig/PasswordDialog.cxx
Normal file
52
win/vncconfig/PasswordDialog.cxx
Normal file
@@ -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;
|
||||
}
|
||||
40
win/vncconfig/PasswordDialog.h
Normal file
40
win/vncconfig/PasswordDialog.h
Normal file
@@ -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
|
||||
59
win/vncconfig/Sharing.h
Normal file
59
win/vncconfig/Sharing.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/* 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
|
||||
* (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_SHARING
|
||||
#define WINVNCCONF_SHARING
|
||||
|
||||
#include <rfb_win32/Registry.h>
|
||||
#include <rfb_win32/Dialog.h>
|
||||
#include <rfb/ServerCore.h>
|
||||
|
||||
namespace rfb {
|
||||
|
||||
namespace win32 {
|
||||
|
||||
class SharingPage : public PropSheetPage {
|
||||
public:
|
||||
SharingPage(const RegKey& rk)
|
||||
: PropSheetPage(GetModuleHandle(0), MAKEINTRESOURCE(IDD_SHARING)), regKey(rk) {}
|
||||
void initDialog() {
|
||||
setItemChecked(IDC_DISCONNECT_CLIENTS, rfb::Server::disconnectClients);
|
||||
setItemChecked(IDC_SHARE_NEVER, rfb::Server::neverShared);
|
||||
setItemChecked(IDC_SHARE_ALWAYS, rfb::Server::alwaysShared);
|
||||
setItemChecked(IDC_SHARE_CLIENT, !(rfb::Server::neverShared || rfb::Server::alwaysShared));
|
||||
}
|
||||
bool onCommand(int id, int cmd) {
|
||||
setChanged((isItemChecked(IDC_DISCONNECT_CLIENTS) != rfb::Server::disconnectClients) ||
|
||||
(isItemChecked(IDC_SHARE_NEVER) != rfb::Server::neverShared) ||
|
||||
(isItemChecked(IDC_SHARE_ALWAYS) != rfb::Server::alwaysShared));
|
||||
return true;
|
||||
}
|
||||
bool onOk() {
|
||||
regKey.setBool(_T("DisconnectClients"), isItemChecked(IDC_DISCONNECT_CLIENTS));
|
||||
regKey.setBool(_T("AlwaysShared"), isItemChecked(IDC_SHARE_ALWAYS));
|
||||
regKey.setBool(_T("NeverShared"), isItemChecked(IDC_SHARE_NEVER));
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
RegKey regKey;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
94
win/vncconfig/resource.h
Normal file
94
win/vncconfig/resource.h
Normal file
@@ -0,0 +1,94 @@
|
||||
// Used by vncconfig.rc
|
||||
|
||||
#include <rfb_win32/resource.h>
|
||||
|
||||
#define IDR_MANIFEST 1
|
||||
#define IDI_ICON 101
|
||||
#define IDD_DIALOG1 102
|
||||
#define IDD_DIALOG2 103
|
||||
#define IDD_CONNECTIONS 105
|
||||
#define IDD_HOOKING 106
|
||||
#define IDD_VNC_PASSWD 107
|
||||
#define IDD_AUTH_VNC_PASSWD 107
|
||||
#define IDD_LEGACY 108
|
||||
#define IDD_CONN_HOST 109
|
||||
#define IDD_SHARING 110
|
||||
#define IDD_INPUTS 111
|
||||
#define IDR_TRAY 112
|
||||
#define IDD_ABOUT 113
|
||||
#define IDI_CONNECTED 115
|
||||
#define IDD_DESKTOP 116
|
||||
#define IDC_EDIT1 1000
|
||||
#define IDC_PORT 1000
|
||||
#define IDC_PASSWORD1 1000
|
||||
#define IDC_HOST_PATTERN 1000
|
||||
#define IDC_AUTH_VNC_PASSWD 1009
|
||||
#define IDC_USEHOOKS 1011
|
||||
#define IDC_POLLCONSOLES 1012
|
||||
#define IDC_COMPAREFB 1013
|
||||
#define IDC_IDLE_TIMEOUT 1015
|
||||
#define IDC_HOSTS 1016
|
||||
#define IDC_HOST_ADD 1017
|
||||
#define IDC_HOST_REMOVE 1018
|
||||
#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_ALLOW 1024
|
||||
#define IDC_DENY 1025
|
||||
#define IDC_SHARE_ALWAYS 1030
|
||||
#define IDC_SHARE_NEVER 1031
|
||||
#define IDC_SHARE_CLIENT 1032
|
||||
#define IDC_DISCONNECT_CLIENTS 1033
|
||||
#define IDC_ACCEPT_KEYS 1034
|
||||
#define IDC_ACCEPT_PTR 1035
|
||||
#define IDC_ACCEPT_CUTTEXT 1036
|
||||
#define IDC_SEND_CUTTEXT 1037
|
||||
#define IDC_PROTOCOL_3_3 1038
|
||||
#define IDC_DESCRIPTION 1039
|
||||
#define IDC_BUILDTIME 1040
|
||||
#define IDC_VERSION 1041
|
||||
#define IDC_COPYRIGHT 1042
|
||||
#define IDC_HTTP_ENABLE 1043
|
||||
#define IDC_HTTP_PORT 1044
|
||||
#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 1055
|
||||
#define IDC_DISCONNECT_NONE 1056
|
||||
#define IDC_DISCONNECT_LOCK 1057
|
||||
#define IDC_DISCONNECT_LOGOFF 1058
|
||||
#define IDC_REMOVE_WALLPAPER 1059
|
||||
#define IDC_DISABLE_EFFECTS 1061
|
||||
#define IDC_CAPTUREBLT 1062
|
||||
#define IDC_QUERY 1064
|
||||
#define IDC_USEPOLLING 1066
|
||||
#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_RFB_ENABLE 1082
|
||||
#define IDC_LOAD_CERT 1087
|
||||
#define IDC_LOAD_CERTKEY 1088
|
||||
#define IDC_RAW_KEYBOARD 1089
|
||||
#define ID_OPTIONS 40001
|
||||
#define ID_CLOSE 40002
|
||||
#define ID_ABOUT 40003
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 117
|
||||
#define _APS_NEXT_COMMAND_VALUE 40004
|
||||
#define _APS_NEXT_CONTROL_VALUE 1083
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
189
win/vncconfig/vncconfig.cxx
Normal file
189
win/vncconfig/vncconfig.cxx
Normal file
@@ -0,0 +1,189 @@
|
||||
/* 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
|
||||
* (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 <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "resource.h"
|
||||
#include <rfb/Logger_stdio.h>
|
||||
#include <rfb/LogWriter.h>
|
||||
#include <rfb_win32/Dialog.h>
|
||||
#include <rfb_win32/RegConfig.h>
|
||||
#include <rfb_win32/CurrentUser.h>
|
||||
|
||||
using namespace rfb;
|
||||
using namespace rfb::win32;
|
||||
|
||||
static LogWriter vlog("main");
|
||||
|
||||
|
||||
#include <vncconfig/Authentication.h>
|
||||
#include <vncconfig/Connections.h>
|
||||
#include <vncconfig/Sharing.h>
|
||||
#include <vncconfig/Hooking.h>
|
||||
#include <vncconfig/Inputs.h>
|
||||
#include <vncconfig/Legacy.h>
|
||||
#include <vncconfig/Desktop.h>
|
||||
|
||||
|
||||
TStr rfb::win32::AppName("KasmVNC Configuration");
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
BoolParameter captureDialogs("CaptureDialogs", "", false);
|
||||
#endif
|
||||
|
||||
HKEY configKey = HKEY_CURRENT_USER;
|
||||
|
||||
|
||||
void
|
||||
processParams(int argc, char* argv[]) {
|
||||
for (int i=1; i<argc; i++) {
|
||||
if (strcasecmp(argv[i], "-service") == 0) {
|
||||
configKey = HKEY_LOCAL_MACHINE;
|
||||
} else if (strcasecmp(argv[i], "-user") == 0) {
|
||||
configKey = HKEY_CURRENT_USER;
|
||||
} else {
|
||||
// Try to process <option>=<value>, or -<bool>
|
||||
if (Configuration::setParam(argv[i], true))
|
||||
continue;
|
||||
// Try to process -<option> <value>
|
||||
if ((argv[i][0] == '-') && (i+1 < argc)) {
|
||||
if (Configuration::setParam(&argv[i][1], argv[i+1], true)) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, char* cmdLine, int cmdShow) {
|
||||
|
||||
// Configure debugging output
|
||||
#ifdef _DEBUG
|
||||
AllocConsole();
|
||||
freopen("CONIN$","rb",stdin);
|
||||
freopen("CONOUT$","wb",stdout);
|
||||
freopen("CONOUT$","wb",stderr);
|
||||
setbuf(stderr, 0);
|
||||
initStdIOLoggers();
|
||||
LogWriter vlog("main");
|
||||
logParams.setParam("*:stderr:100");
|
||||
vlog.info("Starting vncconfig applet");
|
||||
#endif
|
||||
|
||||
Configuration::enableServerParams();
|
||||
|
||||
try {
|
||||
try {
|
||||
// Process command-line args
|
||||
int argc = __argc;
|
||||
char** argv = __argv;
|
||||
processParams(argc, argv);
|
||||
|
||||
/* *** Required if we wish to use IP address control
|
||||
INITCOMMONCONTROLSEX icce;
|
||||
icce.dwSize = sizeof(icce);
|
||||
icce.dwICC = ICC_INTERNET_CLASSES;
|
||||
InitCommonControlsEx(&icce);
|
||||
*/
|
||||
|
||||
// Create the required configuration registry key
|
||||
RegKey rootKey;
|
||||
rootKey.createKey(configKey, _T("Software\\KasmVNC\\WinVNC4"));
|
||||
|
||||
// Override whatever security it already had (NT only)
|
||||
bool warnOnChangePassword = false;
|
||||
try {
|
||||
AccessEntries access;
|
||||
Sid::Administrators adminSID;
|
||||
Sid::SYSTEM systemSID;
|
||||
access.addEntry(adminSID, KEY_ALL_ACCESS, GRANT_ACCESS);
|
||||
access.addEntry(systemSID, KEY_ALL_ACCESS, GRANT_ACCESS);
|
||||
UserSID userSID;
|
||||
if (configKey == HKEY_CURRENT_USER)
|
||||
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);
|
||||
} catch (rdr::SystemException& e) {
|
||||
// Something weird happens on NT 4.0 SP5 but I can't reproduce it on other
|
||||
// NT 4.0 service pack revisions.
|
||||
if (e.err == ERROR_INVALID_PARAMETER) {
|
||||
MsgBox(0, _T("Windows reported an error trying to secure the VNC Server settings for this user. ")
|
||||
_T("Your settings may not be secure!"), MB_ICONWARNING | MB_OK);
|
||||
} else if (e.err != ERROR_CALL_NOT_IMPLEMENTED &&
|
||||
e.err != ERROR_NOT_LOGGED_ON) {
|
||||
// If the call is not implemented, ignore the error and continue
|
||||
throw;
|
||||
}
|
||||
warnOnChangePassword = true;
|
||||
}
|
||||
|
||||
// Start a RegConfig thread, to load in existing settings
|
||||
RegConfigThread config;
|
||||
config.start(configKey, _T("Software\\KasmVNC\\WinVNC4"));
|
||||
|
||||
// Build the dialog
|
||||
std::list<PropSheetPage*> pages;
|
||||
SecPage auth(rootKey); pages.push_back(&auth);
|
||||
auth.setWarnPasswdInsecure(warnOnChangePassword);
|
||||
ConnectionsPage conn(rootKey); pages.push_back(&conn);
|
||||
InputsPage inputs(rootKey); pages.push_back(&inputs);
|
||||
SharingPage sharing(rootKey); pages.push_back(&sharing);
|
||||
DesktopPage desktop(rootKey); pages.push_back(&desktop);
|
||||
HookingPage hooks(rootKey); pages.push_back(&hooks);
|
||||
LegacyPage legacy(rootKey, configKey == HKEY_CURRENT_USER); pages.push_back(&legacy);
|
||||
|
||||
// Load the default icon to use
|
||||
HICON icon = (HICON)LoadImage(inst, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 0, 0, LR_SHARED);
|
||||
|
||||
// Create the PropertySheet handler
|
||||
const TCHAR* propSheetTitle = _T("VNC Server Properties (Service-Mode)");
|
||||
if (configKey == HKEY_CURRENT_USER)
|
||||
propSheetTitle = _T("VNC Server Properties (User-Mode)");
|
||||
PropSheet sheet(inst, propSheetTitle, pages, icon);
|
||||
|
||||
#ifdef _DEBUG
|
||||
vlog.debug("capture dialogs=%s", captureDialogs ? "true" : "false");
|
||||
sheet.showPropSheet(0, true, false, captureDialogs);
|
||||
#else
|
||||
sheet.showPropSheet(0, true, false);
|
||||
#endif
|
||||
} catch (rdr::SystemException& e) {
|
||||
switch (e.err) {
|
||||
case ERROR_ACCESS_DENIED:
|
||||
MsgBox(0, _T("You do not have sufficient access rights to run the VNC Configuration applet"),
|
||||
MB_ICONSTOP | MB_OK);
|
||||
return 1;
|
||||
};
|
||||
throw;
|
||||
}
|
||||
|
||||
} catch (rdr::Exception& e) {
|
||||
MsgBox(NULL, TStr(e.str()), MB_ICONEXCLAMATION | MB_OK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
22
win/vncconfig/vncconfig.exe.manifest
Normal file
22
win/vncconfig/vncconfig.exe.manifest
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
version="4.0.0.26"
|
||||
processorArchitecture="X86"
|
||||
name="KasmVNC.vncconfig.exe"
|
||||
type="win32"
|
||||
/>
|
||||
<description>.NET control deployment tool</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
22
win/vncconfig/vncconfig.exe.manifest64
Normal file
22
win/vncconfig/vncconfig.exe.manifest64
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity
|
||||
version="4.0.0.26"
|
||||
processorArchitecture="AMD64"
|
||||
name="KasmVNC.vncconfig.exe"
|
||||
type="win32"
|
||||
/>
|
||||
<description>.NET control deployment tool</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="AMD64"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
||||
BIN
win/vncconfig/vncconfig.ico
Normal file
BIN
win/vncconfig/vncconfig.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
516
win/vncconfig/vncconfig.rc
Normal file
516
win/vncconfig/vncconfig.rc
Normal file
@@ -0,0 +1,516 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
#include "resdefs.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "windows.h"
|
||||
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""windows.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON ICON DISCARDABLE "vncconfig.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_SECURITY DIALOG DISCARDABLE 0, 0, 180, 220
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Security"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "Session encryption", IDC_STATIC, 7,10,120,60
|
||||
CONTROL "None", IDC_ENC_NONE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
10,20,50,15
|
||||
CONTROL "Anonymous TLS", IDC_ENC_TLS, "Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP, 10,35,80,15
|
||||
CONTROL "TLS with X.509 certificates", IDC_ENC_X509, "Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP, 10,50,110,15
|
||||
GROUPBOX "X.509 certificates", IDC_STATIC, 7,75,185,30
|
||||
PUSHBUTTON "Load X.509 Certificate", IDC_LOAD_CERT, 10,85,80,15
|
||||
PUSHBUTTON "Load X.509 Certificate key", IDC_LOAD_CERTKEY, 90,85,100,15
|
||||
GROUPBOX "Authentication", IDC_STATIC, 7,110,170,60
|
||||
CONTROL "None", IDC_AUTH_NONE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
10,120,50,15
|
||||
CONTROL "Standard VNC", IDC_AUTH_VNC, "Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP, 10,135,80,15
|
||||
PUSHBUTTON "Configure", IDC_AUTH_VNC_PASSWD, 100,135,61,15
|
||||
/*
|
||||
CONTROL "Plaintext", IDC_AUTH_PLAIN, "Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP, 10,150,70,15
|
||||
*/
|
||||
CONTROL "Prompt local user to accept connections",
|
||||
IDC_QUERY_CONNECT, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
7,170,181,15
|
||||
CONTROL "Only prompt when there is a user logged on",
|
||||
IDC_QUERY_LOGGED_ON, "Button", BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,20,185,166,15
|
||||
END
|
||||
|
||||
IDD_CONNECTIONS DIALOG DISCARDABLE 0, 0, 218, 198
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Connections"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
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_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
|
||||
EDITTEXT IDC_HTTP_PORT,150,40,61,15,ES_AUTOHSCROLL | ES_NUMBER
|
||||
GROUPBOX "Access Control",IDC_STATIC,7,55,204,135
|
||||
CONTROL "Only accept connections from the local machine",
|
||||
IDC_LOCALHOST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,
|
||||
70,190,15
|
||||
LISTBOX IDC_HOSTS,15,90,130,95,LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Add",IDC_HOST_ADD,150,90,55,15
|
||||
PUSHBUTTON "&Remove",IDC_HOST_REMOVE,150,110,55,15
|
||||
PUSHBUTTON "Move Up",IDC_HOST_UP,150,130,55,15
|
||||
PUSHBUTTON "Move Down",IDC_HOST_DOWN,150,150,55,15
|
||||
PUSHBUTTON "&Edit",IDC_HOST_EDIT,150,170,55,15
|
||||
END
|
||||
|
||||
IDD_HOOKING DIALOG DISCARDABLE 0, 0, 197, 101
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Capture Method"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
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,25,40,165,15
|
||||
CONTROL "Capture alpha-blended windows",IDC_CAPTUREBLT,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,55,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 "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
|
||||
DEFPUSHBUTTON "OK",IDOK,100,50,50,15
|
||||
PUSHBUTTON "Cancel",IDCANCEL,155,50,50,15
|
||||
END
|
||||
|
||||
IDD_LEGACY DIALOG DISCARDABLE 0, 0, 166, 92
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Legacy"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "&Import VNC 3.3 Settings",IDC_LEGACY_IMPORT,7,10,92,20
|
||||
CONTROL "Only use protocol version 3.3",IDC_PROTOCOL_3_3,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,35,152,15
|
||||
END
|
||||
|
||||
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
|
||||
EDITTEXT IDC_HOST_PATTERN,65,5,100,15,ES_AUTOHSCROLL
|
||||
CONTROL "&Allow",IDC_ALLOW,"Button",BS_AUTORADIOBUTTON |
|
||||
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/16",IDC_STATIC,65,20,100,15
|
||||
END
|
||||
|
||||
IDD_SHARING DIALOG DISCARDABLE 0, 0, 186, 95
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Sharing"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Always treat new connections as shared",
|
||||
IDC_SHARE_ALWAYS,"Button",BS_AUTORADIOBUTTON | WS_GROUP,
|
||||
7,10,172,15
|
||||
CONTROL "Never treat new connections as shared",IDC_SHARE_NEVER,
|
||||
"Button",BS_AUTORADIOBUTTON,7,25,172,15
|
||||
CONTROL "Use client's preferred sharing setting",
|
||||
IDC_SHARE_CLIENT,"Button",BS_AUTORADIOBUTTON,7,40,172,15
|
||||
CONTROL "Non-shared connections replace existing ones",
|
||||
IDC_DISCONNECT_CLIENTS,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,55,172,15
|
||||
END
|
||||
|
||||
IDD_INPUTS DIALOG DISCARDABLE 0, 0, 186, 119
|
||||
STYLE DS_MODALFRAME | DS_CONTROL | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Inputs"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
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 "Send raw keyboard events to applications",IDC_RAW_KEYBOARD,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,40,172,15
|
||||
CONTROL "Accept clipboard updates from clients",
|
||||
IDC_ACCEPT_CUTTEXT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
7,55,172,15
|
||||
CONTROL "Send clipboard updates to clients",IDC_SEND_CUTTEXT,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,70,172,15
|
||||
CONTROL "Allow input events to affect the screen-saver",
|
||||
IDC_AFFECT_SCREENSAVER,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,85,172,15
|
||||
CONTROL "Disable local inputs while server is in use",
|
||||
IDC_DISABLE_LOCAL_INPUTS,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,110,172,15
|
||||
END
|
||||
|
||||
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 300, 92
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "About KasmVNC Config for Windows"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,245,70,47,15
|
||||
ICON IDI_ICON,IDC_STATIC,7,7,20,20
|
||||
LTEXT ">appname<",IDC_DESCRIPTION,40,7,125,18
|
||||
LTEXT ">version<",IDC_VERSION,165,7,77,18
|
||||
LTEXT ">buildtime<",IDC_BUILDTIME,40,25,202,15
|
||||
LTEXT ">copyright<",IDC_COPYRIGHT,40,40,256,15
|
||||
LTEXT "See http://kasmweb.com for more information on KasmVNC.",
|
||||
IDC_STATIC,40,55,202,15
|
||||
END
|
||||
|
||||
IDD_DESKTOP DIALOG DISCARDABLE 0, 0, 185, 137
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CONTROL | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "Desktop"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "While connected",IDC_STATIC,7,5,171,45
|
||||
CONTROL "Remove wallpaper",IDC_REMOVE_WALLPAPER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,15,155,15
|
||||
CONTROL "Disable user interface effects",IDC_DISABLE_EFFECTS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,30,155,14
|
||||
GROUPBOX "When last client disconnects",IDC_STATIC,7,55,171,60
|
||||
CONTROL "Do nothing",IDC_DISCONNECT_NONE,"Button",
|
||||
BS_AUTORADIOBUTTON,15,65,155,15
|
||||
CONTROL "Lock workstation",IDC_DISCONNECT_LOCK,"Button",
|
||||
BS_AUTORADIOBUTTON,15,80,155,15
|
||||
CONTROL "Logoff user",IDC_DISCONNECT_LOGOFF,"Button",
|
||||
BS_AUTORADIOBUTTON,15,95,155,15
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_AUTHENTICATION, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 186
|
||||
VERTGUIDE, 20
|
||||
VERTGUIDE, 49
|
||||
VERTGUIDE, 120
|
||||
VERTGUIDE, 125
|
||||
TOPMARGIN, 7
|
||||
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
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 211
|
||||
VERTGUIDE, 15
|
||||
VERTGUIDE, 145
|
||||
VERTGUIDE, 150
|
||||
VERTGUIDE, 205
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 191
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 40
|
||||
HORZGUIDE, 55
|
||||
HORZGUIDE, 70
|
||||
HORZGUIDE, 85
|
||||
HORZGUIDE, 90
|
||||
HORZGUIDE, 105
|
||||
HORZGUIDE, 110
|
||||
HORZGUIDE, 125
|
||||
HORZGUIDE, 130
|
||||
HORZGUIDE, 145
|
||||
HORZGUIDE, 150
|
||||
HORZGUIDE, 165
|
||||
HORZGUIDE, 170
|
||||
HORZGUIDE, 185
|
||||
HORZGUIDE, 190
|
||||
END
|
||||
|
||||
IDD_HOOKING, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 190
|
||||
VERTGUIDE, 25
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 94
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 40
|
||||
HORZGUIDE, 55
|
||||
HORZGUIDE, 70
|
||||
HORZGUIDE, 85
|
||||
END
|
||||
|
||||
IDD_AUTH_VNC_PASSWD, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 205
|
||||
VERTGUIDE, 70
|
||||
VERTGUIDE, 75
|
||||
VERTGUIDE, 90
|
||||
VERTGUIDE, 100
|
||||
VERTGUIDE, 150
|
||||
VERTGUIDE, 155
|
||||
VERTGUIDE, 205
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 65
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 30
|
||||
HORZGUIDE, 44
|
||||
HORZGUIDE, 50
|
||||
HORZGUIDE, 65
|
||||
END
|
||||
|
||||
IDD_LEGACY, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 159
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 85
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 30
|
||||
HORZGUIDE, 35
|
||||
HORZGUIDE, 50
|
||||
END
|
||||
|
||||
IDD_CONN_HOST, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 220
|
||||
VERTGUIDE, 60
|
||||
VERTGUIDE, 65
|
||||
VERTGUIDE, 115
|
||||
VERTGUIDE, 165
|
||||
VERTGUIDE, 170
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 50
|
||||
HORZGUIDE, 20
|
||||
HORZGUIDE, 35
|
||||
END
|
||||
|
||||
IDD_SHARING, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 88
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 40
|
||||
HORZGUIDE, 55
|
||||
HORZGUIDE, 70
|
||||
END
|
||||
|
||||
IDD_INPUTS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 112
|
||||
HORZGUIDE, 10
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 40
|
||||
HORZGUIDE, 55
|
||||
HORZGUIDE, 70
|
||||
HORZGUIDE, 85
|
||||
HORZGUIDE, 95
|
||||
HORZGUIDE, 110
|
||||
END
|
||||
|
||||
IDD_ABOUT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 242
|
||||
VERTGUIDE, 40
|
||||
VERTGUIDE, 165
|
||||
VERTGUIDE, 195
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 85
|
||||
HORZGUIDE, 7
|
||||
HORZGUIDE, 25
|
||||
HORZGUIDE, 40
|
||||
HORZGUIDE, 55
|
||||
HORZGUIDE, 70
|
||||
END
|
||||
|
||||
IDD_DESKTOP, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 182
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 32
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION __RCVERSION
|
||||
PRODUCTVERSION __RCVERSION
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "080904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "CompanyName", "KasmVNC Project\0"
|
||||
#ifdef WIN64
|
||||
VALUE "FileDescription", "KasmVNC Server Configuration Applet for Win64\0"
|
||||
VALUE "ProductName", "KasmVNC Server Configuration Applet for Win64\0"
|
||||
#else
|
||||
VALUE "FileDescription", "KasmVNC Server Configuration Applet for Win32\0"
|
||||
VALUE "ProductName", "KasmVNC Server Configuration Applet for Win32\0"
|
||||
#endif
|
||||
VALUE "FileVersion", __RCVERSIONSTR
|
||||
VALUE "InternalName", "vncconfig\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2020 KasmVNC Team and many others (see README.md)\0"
|
||||
VALUE "LegalTrademarks", "KasmVNC\0"
|
||||
VALUE "OriginalFilename", "vncconfig.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductVersion", __VERSIONSTR
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x809, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 24
|
||||
//
|
||||
|
||||
#ifdef WIN64
|
||||
IDR_MANIFEST 24 DISCARDABLE "vncconfig.exe.manifest64"
|
||||
#else
|
||||
IDR_MANIFEST 24 DISCARDABLE "vncconfig.exe.manifest"
|
||||
#endif
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
Reference in New Issue
Block a user