Actually... it does.
It's called WinStationConnect, an undocumented function from winsta.dll. It's present in JwaWinsta.pas (
Jedi Apilib):
Delphi-Quellcode:
function WinStationConnectW(hServer:
Handle; SessionId: DWORD;
TargetSessionId: DWORD; pPassword: LPWSTR;
bWait: BOOL): Boolean;
stdcall;
and also in
Jwscl Terminal Server
unit (TJwWTSSession.Connect).
If you switch to a session with the same user you don't need to specify a password in which case you pass empty string (and not nil!).