.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > Windows 7 call to WTSQuerySessionInformation with WTSSessionID returns unexpected result
 

Windows 7 call to WTSQuerySessionInformation with WTSSessionID returns unexpected result

Hi!

I have a call to WTSQuerySessionInformation with WTSSessionID as the information class parameter. When running in Windows XP Pro SP3 and Vista (both 32 bit) and a single user is logged on, the value for the session ID that is returned is 0. However, when running in Windows 7 Ultimate (64 bit) and a single user is logged on, the value for the session ID is now 1. Can anyone explain this?

The aim of the call to WTSQuerySessionInformation is to try to determine how many users are logged on, so if there are any suggestions as to an alternative way of doing this I would be very grateful.

Many thanks in advance!
si.gh
It sounds like you skipped Vista or you would have heard of the infamous session 0 where all services now live. Google "vista session 0". I'd guess you ought to enumerate the sessions instead with WTSEnumerateSessions and look for WTS_SESSION_INFO.State == WTSActive.

But this all has very little to do with the 64-bit .NET framework, the topic of this forum. Ask more questions in the Windows SDK forum.

Hans Passant.
nobugz
It sounds like you skipped Vista or you would have heard of the infamous session 0 where all services now live. Google "vista session 0". I'd guess you ought to enumerate the sessions instead with WTSEnumerateSessions and look for WTS_SESSION_INFO.State == WTSActive.

But this all has very little to do with the 64-bit .NET framework, the topic of this forum. Ask more questions in the Windows SDK forum.

Hans Passant.
nobugz

You can use google to search for other answers

Custom Search

More Threads

• Can we use Enterprise Library 3.1 in both 32bit and 64bit OS
• COM+ Surrogate error
• Sql Server 2005 64bit and CLR integration to Unmanaged dll
• Connections to access on x64 are not possible.
• Why develop in 64Bit
• Problems with using pdf viewer when developing on windows XP 64
• FolderBrowserDialog SEHException on 64-bit machine
• Remoting between a 64 bit server and a 32 bit client
• Problem with Windows.Forms.WebBrowser and ActiveX on 64Bit
• Serial Communication in 64 bit Windows XP