You can download the patch here.
You can download the recompiled winvnc.exe binary (Based on Rev. 495) here.
To use this:
- 1.) Install UltraVNC 1.0.8.2.
2.) Replace the winvnc.exe executable with the one you downloaded (or built with the supplied patch).
3.) Run gpedit.msc
4.) Computer Configuration > Administrative Templates > Windows Logon Options
5.) Double-click on the "Disable or enable software Secure Attention Sequence".
6.) Check "Enable", then select "Services and Ease of Access applications" in the combobox and Apply the modification.- It should not be necessary to reboot the computer, this modification is considered "on the fly".
===================================================================
--- UltraVNC Project Root/UltraVNC/winvnc/winvnc/vistahook.cpp (revision 495)
+++ UltraVNC Project Root/UltraVNC/winvnc/winvnc/vistahook.cpp (working copy)
@@ -214,27 +214,105 @@
strcat(mycommand,"\\");
strcat(mycommand,"cad.exe");
- int nr=(int)ShellExecute(GetDesktopWindow(), "open", mycommand, "", 0, SW_SHOWNORMAL);
- if (nr<=32)
- {
- //error
- //
- if ( nr==SE_ERR_ACCESSDENIED )
- vncTimedMsgBox::Do(
+ HKEY hKey;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+ {
+ DWORD LUAbufSize = 4, isLUAon = 0;
+ RegQueryValueEx(hKey, TEXT("EnableLUA"), NULL, NULL, (LPBYTE)&isLUAon, &LUAbufSize);
+ RegCloseKey(hKey);
+ if (isLUAon == 1)
+ {
+ int nr=(int)ShellExecute(GetDesktopWindow(), "open", mycommand, "", 0, SW_SHOWNORMAL);
+ if (nr<=32)
+ {
+ //error
+ //
+ if ( nr==SE_ERR_ACCESSDENIED )
+ vncTimedMsgBox::Do(
sz_ID_CADPERMISSION,
sz_ID_ULTRAVNC_WARNING,
MB_ICONINFORMATION | MB_OK
);
- if ( nr==ERROR_PATH_NOT_FOUND || nr==ERROR_FILE_NOT_FOUND)
- vncTimedMsgBox::Do(
+ if ( nr==ERROR_PATH_NOT_FOUND || nr==ERROR_FILE_NOT_FOUND)
+ vncTimedMsgBox::Do(
sz_ID_CADERRORFILE,
sz_ID_ULTRAVNC_WARNING,
MB_ICONINFORMATION | MB_OK
);
+ }
+ }
+ else
+ {
+ SC_HANDLE schSCManager;
+ SC_HANDLE schService;
+
+ // Get a handle to the SCM database.
- }
+ schSCManager = OpenSCManager(
+ NULL, // local computer
+ NULL, // ServicesActive database
+ SC_MANAGER_ALL_ACCESS); // full access rights
+ // Create the service
+
+ schService = CreateService(
+ schSCManager, // SCM database
+ "CAD", // name of service
+ "Ctrl+Alt+Delete for VNC", // service name to display
+ SERVICE_ALL_ACCESS, // desired access
+ SERVICE_WIN32_OWN_PROCESS, // service type
+ SERVICE_DEMAND_START, // start type
+ SERVICE_ERROR_NORMAL, // error control type
+ mycommand, // path to service's binary
+ NULL, // no load ordering group
+ NULL, // no tag identifier
+ NULL, // no dependencies
+ NULL, // LocalSystem account
+ NULL); // no password
+
+ // Get a handle to the service.
+
+ schService = OpenService(
+ schSCManager, // SCM database
+ "CAD", // name of service
+ SERVICE_ALL_ACCESS); // full access
+
+ // Attempt to start the service.
+
+ StartService(
+ schService, // handle to service
+ 0, // number of arguments
+ NULL); // no arguments
+
+ CloseServiceHandle(schService);
+ CloseServiceHandle(schSCManager);
+ }
+ }
+ else
+ {
+ int nr=(int)ShellExecute(GetDesktopWindow(), "open", mycommand, "", 0, SW_SHOWNORMAL);
+ if (nr<=32)
+ {
+ //error
+ //
+ if ( nr==SE_ERR_ACCESSDENIED )
+ vncTimedMsgBox::Do(
+ sz_ID_CADPERMISSION,
+ sz_ID_ULTRAVNC_WARNING,
+ MB_ICONINFORMATION | MB_OK
+ );
+
+ if ( nr==ERROR_PATH_NOT_FOUND || nr==ERROR_FILE_NOT_FOUND)
+ vncTimedMsgBox::Do(
+ sz_ID_CADERRORFILE,
+ sz_ID_ULTRAVNC_WARNING,
+ MB_ICONINFORMATION | MB_OK
+ );
+ }
+ }
+
SetThreadDesktop(old_desktop);
CloseDesktop(desktop);
return 0;
[/syntax]