Clientname is not set after a process is created with CreateProcessAsUser and CreateEnvironmentBlock
问题 I have written a C# service running under the local system account. I use it to spawn a process when a user logs in on a Terminalserver. The service implements the OnSessionChange method and receives SessionChangeDescription messages with the corresponding SessionID. I use this SessionID to get an access token from the user with WTSQueryUserToken . I convert this token into a primary token and pass it to CreateEnvironmentBlock to retrieve a pointer to the users environment variables. After