WTSQuerySessionInformation()在Windows Server 2008 R2上失败 [英] WTSQuerySessionInformation() is failing on windows server 2008 R2

查看:185
本文介绍了WTSQuerySessionInformation()在Windows Server 2008 R2上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了win32应用程序.我正在使用WTSQuerySessionInformation()函数查询clientprotocoltype.它工作正常,但在注销过程中如果我调用此函数,它将失败并显示错误代码2.这仅在Windows Server 2008R2 x64 VM计算机上发生.注销期间,它可以与其他操作系统正常工作.

I have written win32 application. I'm using WTSQuerySessionInformation() function to query clientprotocoltype . it works fine but during log-off if i call this function, its getting failed with error code 2. this is happening only on windows server 2008R2 x64 VM machine. It works fine with rest OS during logoff.

我没有找到解决此问题的任何相关解决方案.

I've not find any relevant solution to troubleshoot this issue.

请帮助我...

推荐答案

以我的经验,当您尝试获取正在注销的会话的信息时,经常会看到WTSQuerySessionInformation返回错误,这很可能是因为正在处理会话更改通知时,注销过程正在异步继续进行.我不会依赖于WTSQuerySessionInformation来注销会话.

In my experience, it's quite common to see WTSQuerySessionInformation return errors when you're trying to fetch information for the session that is being logged off, most likely because the logoff process is continuing asynchronously while session change notifications are being processed. I wouldn't rely on calling WTSQuerySessionInformation for the session that is being logged off.

这篇关于WTSQuerySessionInformation()在Windows Server 2008 R2上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆