问题描述
我正在尝试在我拥有管理员权限的远程计算机上使用远程桌面 API,但是 WTSOpenServer
调用总是返回错误 5(拒绝访问").我什至尝试调用 WNetAddConnection2
来建立一个会话,它工作正常(我可以连接到机器上的 IPC$ 或 C$).我还可以使用远程桌面客户端实际启动终端会话.
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.
远程机器运行的是 Windows XP Pro SP3,而我运行的是 Windows XP Pro x64 SP2.
The remote machine is running Windows XP Pro SP3 and I'm running Windows XP Pro x64 SP2.
推荐答案
查看 HKLM\System\CurrentControlSet\Control\TerminalServer\AllowRemoteRPC 的值,在工作站 OS 上默认设置为 0,需要设置为 1使 WTSOpenServer 正常工作.
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.
这篇关于WTSOpenServer 返回“访问被拒绝";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!