@Crescens2k: The code grabbed the active session ID to decide which session to create the process in. If no users were logged in, the code would have grabbed the service session, but due to other factors, that's unreachable anyway.
This was *not* a process that ran at login. This was a process that ran occasionally in response to a user task, and needed to communicate to the user what is in essence a glorified progress bar. If it weren't for the fact the process also ran from non-service triggered events, breaking it into separate processes for worker and display would have been a better idea. The process had high privileges so it could write to the installation directory.
But that's all wide of the point I was making.