From: Geanina[MSFT] on
Hi!

This APi call won't fail in 64 bit, otherwise a lot of Win7 Services will
not work.

Based on your statement: "I tried of creating 64-bit Windows service and
getting the error code
1245(The operation being requested was not performed because the user has not
logged on to the network. The specified service does not exist.)."

it is possible that the call was probably made too early, before user is
logged on, or are you trying to query token for session 0.

Thanks,
Geanina

"nag" wrote:

> Hi,
>
> I'm trying to create the process with logged-on user credentials from 32-bit
> windows service. For getting the user token specified by session id,
> WTSQueryUserToken is used. This API is passed for 32-bit and failed with
> 64-bit OS.
>
> Based on the link http://support.microsoft.com/kb/920754/en-us
> I got concluded that it will fail in 64-bit OS.
>
> I tried of creating 64-bit Windows service and getting the error code
> 1245(The operation being requested was not performed because the user has not
> logged on to the network. The specified service does not exist.).
>
> Could you advise me to get the token of logged-on user specified by
> SessionId via WTSQueryUserToken in 64-bit OS?
>
> Appreciated your help...
>
>
> Thanks,
> Mohan.
>