gpt4 book ai didi

c++ - 在 Windows 上读取性能数据计数器是否需要任何特殊的安全权限?

转载 作者:可可西里 更新时间:2023-11-01 17:59:25 24 4
gpt4 key购买 nike

我正在努力将 Windows 应用程序从始终作为 SYSTEM 帐户运行迁移到作为受限用户帐户运行。这个应用程序做的许多事情之一是查询 Windows Performance Counters为了记录整个系统内存和 CPU 使用情况。 MSDN 的 list of Privilege Constants是模糊的,但 SE_PROF_SINGLE_PROCESS_NAMESE_SYSTEM_PROFILE_NAME 让我觉得可能需要这种操作。但是,MSDN 的功能文档如PdhOpenQuery , PdhAddCounter , 和 PdhCollectQueryData不要提及任何必需的特权。

鉴于此,查询性能数据计数器是否需要任何权限?或者,SE_PROF_SINGLE_PROCESS_NAMESE_SYSTEM_PROFILE_NAME 权限具体授予访问权限是什么?

最佳答案

“关于性能计数器”的描述中提到了所需的权限 here :

Only the administrator of the computer or users in the Performance Logs User Group can log and view counter data. Users in the Administrator group can log and view counter data only if the tool they use to log and view counter data is started from a Command Prompt window that is opened with Run as administrator.... Users in the Performance Monitoring Users group can view counter data.

Windows XP: The Administrator or users in the Administrator group can log and view counter data without restriction.

关于c++ - 在 Windows 上读取性能数据计数器是否需要任何特殊的安全权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28817485/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com