I have been working on allowing someone to impersonate a user, ( see: Access Violation in LogonUserW in Python 3 )
I have verified this as os.getlogin() returns a different user now, and file-access permissions behavior changed accordingly to the impersonated user.
However I noticed that the environment variables does not change, since they are cached upon startup. What could I do, so that I might be able to refresh the environment variables for the impersonated user.