问题
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.
Kindly help me...
回答1:
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.
来源:https://stackoverflow.com/questions/19428951/wtsquerysessioninformation-is-failing-on-windows-server-2008-r2