I'm trying to start a user-mode process from a service using CreateProcessAsUser() API similar to this code. My code works fine in 99% of the time, except at times that API succeeds, I get the process handle from the PROCESS_INFORMATION struct but the process itself doesn't appear in the interactive user session that I was intending it to run in.
The interesting thing is that if I call GetExitCodeProcess() on the process handle it succeeds with return code 0xC0000142. Any idea why?
See Question&Answers more detail:os