views:

87

answers:

0

Hi.
I use the following to elevate the rights of a c++ windows application:

LogonUser()
LoadUserProfile()
ImpersonateLoggedOnUser()

The functions do their work and there is no error. But as soon as I want to interact with my application again (clicking on a menu like "File" "Edit", and even right clicking on the desktop) the application freezes. The only option is to kill the application and try again.

One strange thing that I observed is, that it works under this conditions:

  • I log out from windows,
  • then log in to windows again using the user which I want to use in the LogonUser() function above,
  • then log out of windows
  • and log into windows with my own user again,
  • and run the code above,

Then the application does not freeze. So perhaps it is an issue with roaming user profiles. Any hints?