amilewski
amilewski

Reputation: 125

Access denied in WinStationConnectW on Windows10

I have been using code which worked well on XP 32bit for years, now PC is upgraded to Windows10 Home 32bit and code no longer works.

ProcessId := GetCurrentProcessId;
ProcessIdToSessionId(ProcessId,SessionId);
WinStationConnectW(SERVERNAME_CURRENT, SessionId,WTSGetActiveConsoleSessionId, '', False);

Code is running in response to WTS_REMOTE_DISCONNECT message in Delphi7 with JwaWindows. Purpose of this code is to switch user session back to console after RDP session is closed, without this Windows displays logon screen and my kiosk application is not visible on the local screen. Error returned by WinStationConnectW is Error_Access_Denied.

Can anyone help?

Upvotes: 0

Views: 436

Answers (0)

Related Questions