New Process in WinXP

  • Thread starter Thread starter Ahmed Perlom
  • Start date Start date
A

Ahmed Perlom

Hi all,

I want to create a window system service that sits on the background and
just fire another service/executable (i.e, notepad) every time a new user
fast switches to a new session. How can I start a new process in another
user sessions in WinXP using .NET 1.1 or 2.0? also how can detect the event
of user fast switch to a new session?

thanks in advance...
 
Hi Ahmed,

As for user logon/logoff events, you can use System Event Notification
Manager (see MSDN docs on the ISensLogon and ISensLogon2 interfaces). As for
running a process as a user, you can probably use the CreateProcessAsUser
API, but I am not sure how do you obtain the logged on user's token.
 
Thanks Dmytro.

The user identity might not be important to me. I wonder if there is nay
security constraints that a local system service could start another
executable whenever another user logins or fast switch to a session? Do you
think ignoring the user identity would make it any easier to implement?
 
Ahmed,

"Local system" can be an account with quite restricted rights (for example,
AFAIR it cannot access the network). So you may wish to consider running
your service at least under the "NETWORK SERVICE" account or even a more
privileged account.
 
Back
Top