英文:
How can I convert a native (NT) registry key name into a Win32 name?
问题
调用NtQueryKey并使用KeyNameInformation选项返回的结果以Native格式呈现如下:
\REGISTRY\MACHINE = HKLM
\REGISTRY\USER\<SID> = HKCU
\REGISTRY\USER = HKU
\REGISTRY\MACHINE\SYSTEM\ControlSet<Current>\Hardware Profiles\<CurrentID> = HKCC
\REGISTRY\USER\<SID>_CLASSES = HKCR (用户的)
\REGISTRY\Machine\SOFTWARE\Classes = HKCR (系统)
如何可靠地将这种NT格式转换为Win32注册表键?
英文:
Calling NtQueryKey with KeyNameInformation returns result in the Native format like so:
\REGISTRY\MACHINE = HKLM
\REGISTRY\USER\<SID> = HKCU
\REGISTRY\USER = HKU
\REGISTRY\MACHINE\SYSTEM\ControlSet<Current>\Hardware Profiles\<CurrentID> = HKCC
\REGISTRY\USER\<SID>_CLASSES = HKCR (User's)
\REGISTRY\Machine\SOFTWARE\Classes = HKCR (System)
How can I reliably convert such NT format to the Win32 registry key?
答案1
得分: 0
主题已解决。
似乎没有直接的API来进行转换。
要使其可靠,只需打开HKCR、HKCU、HKCC => 使用NtQueryKey + KeyNameInformation检索实际的NT名称(对于已知和静态路径的HKU、HKLM已知) => 然后按特定顺序应用相反的自动替换以获取所需的NT路径。
英文:
Topic is solved.
It seems they're no direct API to do the conversion.
To make it reliably, just open HKCR, HKCU, HKCC => retrieve the actual NT name using NtQueryKey + KeyNameInformation (for HKU, HKLM that's already known and static paths) => than apply vice versa auto-replacement for the desired NT path in a specific order.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论