Re: Spawning a Program From a Serivce Under Terminal Services?
- From: "Skywing" <skywing_NO_SPAM_@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 7 Nov 2005 20:39:37 -0500
Try using CreateProcessAsUser. You'll want to first call
SetTokenInformation(Token, TokenSessionId, &SessionId, sizeof(DWORD)) on the
token first to specify which terminal session the process should run as.
Note that you will need SeTcbPrivilege to be enabled for the thread that
calls SetTokenInformation for TokenSessionId.
Alternatively, you could use WTSQueryUserToken to retrieve a token handle
for the interactive user on a particular terminal session and pass that
directly to CreateProcessAsUser. This call also requires SeTcbPrivilege.
"David White" <whitedavidp@xxxxxxxxxxx> wrote in message
news:OY2x6R94FHA.1184@xxxxxxxxxxxxxxxxxxxxxxx
>I have a service process running on Win2003 with TS. It waits for
>connections to a Virtual Serial Port which it has created and is servicing.
>When a communications program opens the virtual serial port, I want me
>service to be able to start a program on the desktop of the user who's
>communications program opened the port. This program simply queries the
>user for some info and displays some responses to/from the service (perhaps
>via a pipe).
>
> At this point, I am able to discern the process which holds the comm port
> open (see previous posts). From this process, I can get the SessionId
> established by that user.
>
> So what is involved in starting a program and having it run in that
> session/display on that user's desktop? It looks as if the startup info
> structure passed to CreateProcess can hold a desktop pointer. Could it be
> as easy as supplying this information? If not, can anyone provide a tip on
> how I can accomplish this given the info I have?
>
> Thanks,
>
> David
.
- References:
- Spawning a Program From a Serivce Under Terminal Services?
- From: David White
- Spawning a Program From a Serivce Under Terminal Services?
- Prev by Date: Re: Windows Xp Unique ID
- Next by Date: Re: HeapAlloc heap fragmentation.
- Previous by thread: Spawning a Program From a Serivce Under Terminal Services?
- Next by thread: HeapAlloc heap fragmentation.
- Index(es):
Relevant Pages
|