views:

217

answers:

2

Hello!

Let's say I have 3 logged on users. I have a test application which I use to enumerate the WTS sessions on the local computer, using WTSEnumerateSessions. After that, I display the information contained in each of the returned WTS_SESSION_INFO structure.

On Windows XP, there are 3 structures displayed: Session 0, 1, and 3 (for each logged on user), with the name "Console" corresponding to the active user under which I run the test application, and an empty string as the name for the other sessions. For example, if I run the application under the first user, I get Session 0 (Console), Session 1 (), Session 2 ().

On Windows Vista, there are 5 structures displayed: Session 0 (Services), Session 1 (Console), Session 2 (), Session 3 (), Session 65536 (RDP-Tcp). On another computer with Windows Vista, I get only the first four sessions (without 65536, RDP-Tcp).

I would like to know if there is a way (better way) of finding out how many logged on users are on the local machine.

Thanks in advance!

A: 

I created a test application using LsaEnumerateLogonSessions and LsaGetLogonSessionData which displays the number of interactive logged on users. It works fine on Windows XP, but it displays 2 interactive looged on users on Windows Vista, even though I have only one user: the Administrator.

Can anyone tell me why this happens?

Thanks!