UACselfElevation

May 2, 2012 at 4:55 PM

I thingk there is a flaw in the Code!
The Code is using:

NativeMethods.OpenProcessToken(Process.GetCurrentProcess.Handle, .....

This returns the Current Process Token.
If the Code runs under a Impersionated Thread the Code returns the wrong Usertoken!

I think its better to use:

NativeMethods.OpenThreadToken(Thread.CurrentTread, .....