Detect admin privilege due to elevation?

  • Thread starter Thread starter Frank S
  • Start date Start date
F

Frank S

What API can I use to distinguish between having administrator privilege normally, versus having
administrator privilege due to elevation (where a user is prompted to enter an admin account and
password)?
 
None. There is no difference between the two. You could look to see if UAC is
enabled and surmise from that.
 
Frank said:
What API can I use to distinguish between having administrator privilege
normally, versus having administrator privilege due to elevation (where a
user is prompted to enter an admin account and password)?

You can use GetTokenElevation() with a TOKEN_INFORMATION_CLASS of
TokenElevation or TokenElevationType to determine if and how a token is
elevated. The Windows SDK does not seem to have these values documented, so
you may have to look at winnt.h to see what can be returned for these.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top