3 ms·
To my surprise I just faced a similar problem on Windows when I was implementing additional user-based isolation for my p2p cloud gaming service (the main one i
by lostmsu 3y ago
To my surprise I just faced a similar problem on Windows when I was implementing additional user-based isolation for my p2p cloud gaming service (the main one is VM boundary).
Apparently when you create a process as another user on Windows by default the new process inherits parent's environment variables even though they belong to different users. That includes user-specific paths such as $TMP or $APPDATA. So most programs immediately fail because they try to write to the temp directory of parent's user.
Solved this with a combination of LoadUserProfile and GetEnvironmentBlock.
- WirelessGigabit 3y agoSidenote: If you elevate as yourself you do NOT inherit environment variables!