问题
I'm trying to use the Remote Desktop API on a remote machine that I have Administrator rights on, however the WTSOpenServer
call always returns error 5 ("Access denied"). I even tried calling WNetAddConnection2
to establish a session, which works fine (I can connect to IPC$ or C$) on the machine). I can also use the Remote Desktop client to actually start a terminal session to it.
The remote machine is running Windows XP Pro SP3 and I'm running Windows XP Pro x64 SP2.
回答1:
Check the value of HKLM\System\CurrentControlSet\Control\TerminalServer\AllowRemoteRPC, it is set to 0 by default on workstation OS and needs to be set to 1 for WTSOpenServer to work.
来源:https://stackoverflow.com/questions/3233737/wtsopenserver-returns-access-denied