问题描述
- 创建一个名为HKCU \Software \Substitute\HKCR
- 的密钥,将RegOverridePredefKey调用以将HKEY_CLASSES_ROOT重定向到该密钥
- 启动RegMon跟踪注册表更改
- 加载我的DLL并调用其DllRegisterServer成员函数
RegMon摘录显示COM一切正常object注册其CLSID条目。
The RegMon excerpt shows that everything works fine while the COM object registers its CLSID entries.
但是一旦它尝试修改HKCR \ TypeLib,它就会收到拒绝访问。如果我使用提升权限运行该进程,则注册成功,但HKCR \ TypeLib和HKCR \Interface键未重定向到HKCU \Software \Substitute\HKCR。
But as soon as it attempts to modify HKCR\TypeLib, it receives an Access Denied. If I run the process with elevated rights, the registration succeeds, but the keys HKCR\TypeLib and HKCR\Interface are NOT redirected to HKCU\Software\Substitute\HKCR.
为什么RegOverridePredefKey不会将整个HKEY_CLASSES_ROOT树映射到替代密钥,因为MSDN文档说明了?
不用如果只跟踪所有注册表变化的一小部分,那么该功能的整个目的就会被破坏。
Needless to say that the whole purpose of that function is undermined if it tracks only a minor fraction of all registry changes.
RegCreateKey SUCCESS HKCU\Software\Substitute\HKCR\CLSID\{55F62C09-8202-11D3-9B2A-00104BB92514} Desired Access: Read/Write
RegCreateKey SUCCESS HKCU\Software\Substitute\HKCR\CLSID\{55F62C09-8202-11D3-9B2A-00104BB92514}\ProgID Desired Access: Read/Write
RegCreateKey SUCCESS HKCU\Software\Substitute\HKCR\CLSID\{55F62C09-8202-11D3-9B2A-00104BB92514}\VersionIndependentProgID Desired Access: Read/Write
RegCreateKey SUCCESS HKCU\Software\Substitute\HKCR\CLSID\{55F62C09-8202-11D3-9B2A-00104BB92514}\InprocServer32 Desired Access: Read/Write
RegCreateKey SUCCESS HKCU\Software\Substitute\HKCR\CLSID\{55F62C09-8202-11D3-9B2A-00104BB92514}\TypeLib Desired Access: Read/Write
RegSetInfoKey SUCCESS HKCR KeySetInformationClass: KeySetHandleTagsInformation, Length: 0
RegCreateKey ACCESS DENIED HKCR\TypeLib\{55F62BF3-8202-11D3-9B2A-00104BB92514} Desired Access: Maximum Allowed
RegCreateKey SUCCESS HKCR\TypeLib Desired Access: Maximum Allowed, Granted Access: Read
RegSetInfoKey SUCCESS HKCR\TypeLib KeySetInformationClass: KeySetHandleTagsInformation, Length: 0
RegCreateKey ACCESS DENIED HKCR\TypeLib\{55F62BF3-8202-11D3-9B2A-00104BB92514} Desired Access: Maximum Allowed
推荐答案
这篇关于RegOverridePredefKey拒绝重定向HKCR \ TypeLib和HKCR \Interface的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!