问题
How can I check if a process has elevated privileges in Windows 7 (using native C++, not C#/C++.net) ?
I've been looking for an answer for quite sometimes, but all I can find are the answers that use the .NET framework.
回答1:
The simplest approach is to call the IsUserAnAdmin function. If you need more precision you can also use GetTokenInformation but in most cases that is overkill.
来源:https://stackoverflow.com/questions/4196552/how-to-check-if-a-process-has-elevated-privileges-in-windows-7-using-native-c