CreateProcessAsUser fails on XP x64

I'm seeing a very strange issue with respect to CreateProcessAsUser
fails and GetLastError returns error code 233 (ERROR_PIPE_NOT_CONNECTED
or "No process is on the other end of the pipe"), but this only happens
on the 64-bit version of Windows XP (I haven't tested on any non-XP
OSes).

I've tried using CreateProcessAsUserW since I had seen several remarks
that CreateProcessAsUserA's implementation was a little buggy, but
still the same problem.

Here's a description of what my application is doing.

I'm running as service (thus in session 0). My service has registered
to receive session notification messages. Whenever I receive a logon
message (indicating a user has logged on), I grab the session number,
change the TokenSessionId on a copy of my own token, and use that token
to issue a CreateProcessAsUser call to open up notepad.exe in the new
session, with the credentials of my service account (Yes I know this is
a security issue, which we will address as soon as we resolve the
current issue). On 32-bit XP, everything works beautifully. On 64-bit
XP, I get the aforementioned error.

Anyone else seen a similar issue, or know why this is happening?

Thanks.
[1329 byte] By [MichaelB.Price] at [2007-12-21]
# 1

Inside CreateProcessAsUser, I believe pipe is used to send the request to the Win32 server process (CSRSS.exe) on the desired session.

Can you share your code?

advdbg at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 2

I guess that the problem is in the transition from a 32bit api to the internal 64 bit api. I have the same problem and a test program which fails when built as 32bit works when built as 64. My workaround is for my 32bit program to spawn a 64bit helper program which calls CreateProcessAsUser for me.

rejm at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 3
Did you solve it? I have the same problem, but with Windows 2003 64 bits...
gonlazaro at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 4
I have the same problem on CreateProcessAsUser - works beautifully on Windows2000 but craps out on 2003.....
CoffeeWally at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 5

I'm having the same problem but on 32bit XP. Vista works. Has anyone solved this?

The hack for the moment is to trap the error and retry. If you pause for a second or two, it works. I think the WTS Logon event is received before everything is ready to go in the user's session. What is that dependency?

firewalker at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 6

I have also the same problem on Windows XP. On Vista my code works.

Has it something to do with privileges or security?

DimitriMeeuws at 2007-9-10 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...

Software Development for Windows Vista

Site Classified