How to check if a process has elevated privileges in windows 7 using native C++?

冷暖自知 提交于 2019-12-12 10:38:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!