On a windows 2003 server, running from a service, createprocessasuser fails with error 87, and an error from WLEXECSERVER that says fails to impersonate user.
On a windows 2003 server 64 bit, running from a service, createprocessasuser fails with error 1349.
The token is created using OpenProcess -> OpenProcessToken(TOKEN_QUERY, TOKEN_DUPLICATE) -> DuplicateTokenEx (WITH GRANT_ALL, PrimaryToken, SecurityImpersonation).
On WIN7 and 2008 R2 it works fine with no problems.
If i take the token with WTSQueryUserToken, it works fine also.
Anyone has an idea why?