CreateProcessAsUser returns FALSE but GetLastError returns 0

  • Thread starter Thread starter mmichlin
  • Start date Start date
M

mmichlin

Guest
Hi,

I am launching a process using the CreateProcessAsUser function from a
Windows service running under Local System. The process is supposed to run in
the Terminal Session, defined by the user token handle (that I get using the
WTSQueryUserToken). This works fine on 2003 SP1 but doesn't work on 2003 SP2.
And what puzzles me most of all is that although the function fails (returns
FALSE) the GetLastError returns 0 (no error).

My trying to launch the process occurse just right the new Terminal Session
was logged in by the user and if I wait a little (second or so) and repeat
the attempt, the process is created successfully. However, I still think that
returning 0 from GetLastError after failed API function call is a bug. So
anybody who knows what's going on and/or how I can report the bug to
Microsoft, please let me know.

Thanks

It seems
 
Re: CreateProcessAsUser returns FALSE but GetLastError returns 0

Hello, you can contact Ms Product support by following the information on
this page.
http://support.microsoft.com/
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"mmichlin" <mmichlin@discussions.microsoft.com> wrote in message
news:65D8652A-9FC1-43D8-9221-99CF7DDA1421@microsoft.com...
> Hi,
>
> I am launching a process using the CreateProcessAsUser function from a
> Windows service running under Local System. The process is supposed to run
> in
> the Terminal Session, defined by the user token handle (that I get using
> the
> WTSQueryUserToken). This works fine on 2003 SP1 but doesn't work on 2003
> SP2.
> And what puzzles me most of all is that although the function fails
> (returns
> FALSE) the GetLastError returns 0 (no error).
>
> My trying to launch the process occurse just right the new Terminal
> Session
> was logged in by the user and if I wait a little (second or so) and repeat
> the attempt, the process is created successfully. However, I still think
> that
> returning 0 from GetLastError after failed API function call is a bug. So
> anybody who knows what's going on and/or how I can report the bug to
> Microsoft, please let me know.
>
> Thanks
>
> It seems
 
Back
Top