Just a note: I am very positive that I have connected to a server (with WinVNC, if I recall correctly) that I could send a CTRL-ALT-DEL to, to lock the workstation, and it worked. This would seem to indicate that it is possible to emulate it, as the workstation which is also running Win VNC must give the command to lock the station (unless, of course, there is another way to do this, and it is using that method, instead). Any ideas?
Maybe they used the LockWorkStation function?
I figured a command existed to do that. This eliminates Win VNC from being proof that sending a real CTRL-ALT-DEL is possible.
Not really. LockWorkstation() does the same as pressing CTRL+ALT+DEL *AND* selecting "Lock Workstation". It doesn't just simulate the CTRL+ALT+DEL shortcut.
No, but Jason's suspicion was based on the fact that VNC on a remote machine was able to lock the remote workstation, i.e. may have generated the Ctrl-Alt-Del sequence programatically on the remote host.
There is a command in WinVNC to send CTRL-ALT-DEL. This is used to log on, etc.., so it must be sending the command.
I looked briefly in the source, and they seem to be using a Java class for this.
This was my suspicion, as adrianxw noted, but if there are other commands that can be performed on the local version of WinVNC to perform these same actions, then sending a CTRL-ALT-DEL is not necessary from the remote WinVNC, nor the local one. Assuming these other commands exist, such as LockWorkStation(), then the remote WinVNC can simply send a message that indicates what command should be performed, and the local WinVNC interpretes the message, and calls one of these other commands that emulates what would have happened if a local user pressed CTRL-ALT-DEL.
So is there no way to manually send the interrupt information that CTRL-ALT-DELETE does? I mean, maybe using assembler or something?
Why exactly do you need to send ctrl-alt-del? In the VncViewer source they use the function below to simulate this. You can download the source from the posted link:
vnclog.Print(LL_ALL, VNCLOG("preparing to generate ctrl-alt-del\n"));
// Are we running on NT?
vnclog.Print(LL_ALL, VNCLOG("spawn ctrl-alt-del thread...\n"));
// *** This is an unpleasant hack. Oh dear.
// I simulate CtrAltDel by posting a WM_HOTKEY message to all
// the windows on the Winlogon desktop.
// This requires that the current thread is part of the Winlogon desktop.
// But the current thread has hooks set & a window open, so it can't
// switch desktops, so I instead spawn a new thread & let that do the work...
omni_thread *thread = omni_thread::create(SimulateCtrlAltDelThreadFn);
if (thread == NULL)