Is it possible to impersonate a user without logging him on?

impersonation, security, visual-c++, winapi

Solution

No, you have to call Win32 API LogonUser function to get windows account token back so you can then impersonate.

Problem

Is it possible to impersonate a user without supplying user name/password? Basically, I'd like to get the `CSIDL_LOCAL_APPDATA` for a user (not the current one) using the `ShGetFolderPath()` function. All I currently have is a SID for that user.

Original source