question

abbasshaikh-3984 avatar image
0 Votes"
abbasshaikh-3984 asked JiaYou-MSFT commented

Windows service launch UI in wrong user session in RDP multiuser session

I had develop windows file watcher service to launch UI (as user give file print from menu) using createuserprocess winapi. It works fine for single user. For multi user this UI get launch in wrong user's session.

So I need launch UI in respective user's session

Any help appreciated

windows-serverwindows-apiremote-desktop-services
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HI

I haven't heard back from you yet, so I just wanted to follow up with you.

0 Votes 0 ·
RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered

How are you obtaining the token you are passing to CreateProcessAsUser?

The token that you pass to CreateProcessAsUser must contain the proper session number. The session can be set with SetTokenInformation.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

abbasshaikh-3984 avatar image
0 Votes"
abbasshaikh-3984 answered RLWA32-6355 edited

Thanks for reply.

I use winapi method WTSQuerySessionInformation to get session id. But it all sessionids currently connected users.

I need sessionid of user who fire command to launch UI app.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is checking for WTS_ACTIVE state definitive for Windows Server? Can't more than one RDP session be active?

0 Votes 0 ·

Again, how are you obtaining the token for CreateProcessAsUser?

Is the problem that you are starting a process for the correct user in the wrong session or is it that you are starting a process for the wrong user?

And "fire command" doesn't mean anything to me. Exactly how is the process in the user's interactive session communicating with the service?

0 Votes 0 ·