diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-01-12 12:32:15 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-01-12 12:32:15 +0100 |
commit | fc08bee5afdb07830d6c6fb28359a020a5c305c5 (patch) | |
tree | e2009681235886e7c9e6669f0939b679815fcfab /win/winvnc/VNCServerService.cxx | |
parent | 4ab1e5d4b5ebaac0c410eedcc76865736aaa6ae4 (diff) | |
download | tigervnc-fc08bee5afdb07830d6c6fb28359a020a5c305c5.tar.gz tigervnc-fc08bee5afdb07830d6c6fb28359a020a5c305c5.zip |
Remove legacy Windows code
We have lots of code that deals with Windows versions that we no
longer support anyway. Clean out all of this old cruft.
Diffstat (limited to 'win/winvnc/VNCServerService.cxx')
-rw-r--r-- | win/winvnc/VNCServerService.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/win/winvnc/VNCServerService.cxx b/win/winvnc/VNCServerService.cxx index 0357677a..5656de04 100644 --- a/win/winvnc/VNCServerService.cxx +++ b/win/winvnc/VNCServerService.cxx @@ -19,9 +19,9 @@ // -=- WinVNC Version 4.0 Service-Mode implementation #include <winvnc/VNCServerService.h> -#include <rfb_win32/OSVersion.h> #include <rfb_win32/TsSessions.h> #include <rfb_win32/ModuleFileName.h> +#include <windows.h> #include <wtsapi32.h> #include <tlhelp32.h> @@ -31,19 +31,25 @@ using namespace win32; const TCHAR* winvnc::VNCServerService::Name = _T("TigerVNC"); +// SendSAS is not available until Windows 7, and missing from MinGW +static HMODULE sasLibrary = NULL; +typedef void WINAPI (*SendSAS_proto)(BOOL AsUser); +static SendSAS_proto _SendSAS = NULL; + VNCServerService::VNCServerService() : Service(Name) - , SendSas(_T("sas.dll"), "SendSAS") , stopServiceEvent(CreateEvent(0, FALSE, FALSE, 0)) , sessionEvent(CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNC")) , sessionEventCad(CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNCCad")) { + if (sasLibrary == NULL) { + sasLibrary = LoadLibrary("sas.dll"); + if (sasLibrary != NULL) + _SendSAS = (SendSAS_proto)GetProcAddress(sasLibrary, "SendSAS"); + } // - Set the service-mode logging defaults // These will be overridden by the Log option in the // registry, if present. - if (osVersion.isPlatformNT) - logParams.setParam("*:EventLog:0,Connections:EventLog:100"); - else - logParams.setParam("*:file:0,Connections:file:100"); + logParams.setParam("*:EventLog:0,Connections:EventLog:100"); } @@ -136,8 +142,8 @@ DWORD VNCServerService::serviceMain(int argc, TCHAR* argv[]) //cad request case WAIT_OBJECT_0 + 1: - if (SendSas.isValid()) - (*SendSas)(FALSE); + if (_SendSAS != NULL) + _SendSAS(FALSE); break; case WAIT_TIMEOUT: |