Re: How to get the current active desktop

From: Adam Overton [MS] (adamo@online.microsoft.com)
Date: 06/24/02


From: "Adam Overton [MS]" <adamo@online.microsoft.com>
Date: Mon, 24 Jun 2002 09:11:15 -0700


It's not the active console session you want, (which you could get with
WTSGetActiveConsoleSessionId), but the RPC caller. I think you can get this
by impersonating the RPC caller and then querying the information. I don't
have specific instructions on this, so consider this a lead rather than a
complete solution.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Manoj" <m_s77@hotmail.com> wrote in message
news:eM9zGMDGCHA.1920@tkmsftngp08...
> Hello,
>
> I have got a service which runs under a user who is a member of
> Administrators group. I have assigned this group SE_TCB_NAME,
SE_DEBUG_NAME,
> SE_ASSIGNPRIMARYTOKEN_NAME and SE_INCREASE_QUOTA_NAME priviledges.
>
> This service runs requested process for the clients with some specific
> priviledges. Now the process has to be run on the same desktop from where
> the request has been made.
>
> But for a terminal service client or for windowsXp Fast User switching
mode,
> how can I get the desktop name. As per WTS documentation
>
> WTSQuerySessionInformation -WTSWinStationName : Pointer to a
null-terminated
> string containing the name of the specified session.
> Note: Despite its name, specifying this type does not return the window
> station name. Rather, it returns the name of the Terminal Services
session.
> Each Terminal Services session is associated with an interactive window
> station. Currently, since the only supported window station name for an
> interactive window station is "WinSta0", each session is associated with
its
> own "WinSta0" window station.
>
> So it means I will always get windows station name as winsta0.
>
> Thats why it is important to get the desktop name especially for
WindowsXP.
>
> Is it possible ? if yes then please help me out.
>
> regards,
>
> Manoj
>
>
>
>
>
>
>
>
>
>
>
>
>


Relevant Pages

  • Re: Desktop Creation
    ... If I must store a secret I use CryptProtectDataAPI. ... But I don't understand what the resource creation is a potential security ... CreateDekstopuse the attached window station of the processus that call ... session 1 and communicate with an IPC with the SYSTEM service. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to access the desktop of the interactive user?
    ... interactive user, even a console user, goes to session 1). ... Every window station has its own logical combination ... > the Winsta0 and interactive desktop, ... we can use SendInput to generate the keyboard event ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Remote Desktop Sessions
    ... with Fast User Switching each user is assigned their own ... they get their own interactive window station, ... You cannot use this handle value to detect if you are running in a TS session or in a FUS session or if you are in a nonzero TS session or an RDP session or whatever else the original poster wanted to know. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to access the desktop of the interactive user?
    ... service gets its own window station named according to its logon id. ... [or the default interactive desktop] ... for the current session. ... I believe that this will no longer work on Vista because session 0 ...
    (microsoft.public.win32.programmer.kernel)
  • Re: GroupPolicy reconnect from original client only Policy&Termina
    ... wich should be able to reconnect to his old session if he disconects his ... If you want one connection for client you must configure that each client ... GPO "Restrict Terminal Services Users to a single remote session". ...
    (microsoft.public.windows.server.active_directory)

Quantcast