I have a process that needs SYSTEM privileges and for this to be released by a service. When this process runs the GetOpenFileName () to open a select files dialog, I get an error message saying
C: \ Windows \ system32 \ config \ systemprofile \ Desktop is not available.
The Desktop, My Documents, etc. folders, when selected in the dialog box, are associated with the SYSTEM account. This is because the process is running with SYSTEM privileges. Right.
I tried to solve this problem by impersonating the application with the ImpersonateLoggedOnUser (), but the GetOpenFileName () continues to be associated with the system account and displaying the same error messages.
I've also tried with the new API dialog box, the Common Item Dialog, but the same thing happens. The strange thing is that if the process is impersonated as a user, the GetUserName () returns the correct name of the personified user.
What might be the reason for this?