gpt4 book ai didi

c++ - 通过注册表递归的最佳方法 (C++)?

转载 作者:行者123 更新时间:2023-11-28 03:14:58 24 4
gpt4 key购买 nike

长话短说,我正在尝试创建位于二进制 .dat 文件中的两个注册表配置单元的差异。

使用 RegLoadAppKey 安装配置单元后,递归所有键及其值的最佳方法是什么?

我查看了 RegEnumKeyEx,但它只允许我遍历 RegLoadAppKey 返回的根节点的子键,并且(据我所知)不会返回任何类型的子键句柄。

另外,我使用 RegLoadAppKey 的原因是因为这个迷你应用程序需要能够在没有管理员权限的情况下运行。

最佳答案

不做湿毯子

来自 RegLoadAppKey 上的 MSDN 文档 http://msdn.microsoft.com/en-us/library/windows/desktop/ms724886(v=vs.85).aspx

Unlike RegLoadKey, RegLoadAppKey does not load the hive under HKEY_LOCAL_MACHINE or HKEY_USERS. Instead, the hive is loaded under a special root that cannot be enumerated. As a result, there is no way to enumerate hives currently loaded by RegLoadAppKey

此外,您可能会在您试图避免的一些安全设置上遇到障碍

All keys inside the hive must have the same security descriptor, otherwise the function will fail. This security descriptor must grant the caller the access specified by the samDesired parameter or the function will fail. You cannot use the RegSetKeySecurity function on any key inside the hive.

关于c++ - 通过注册表递归的最佳方法 (C++)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17194955/

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