简体   繁体   中英

Registry on 32-bit and 64-bit Windows

I have a problem with the registry in Windows x64. I need to get a value added through file.reg:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\My Soft]
"Str1" = "Assa"
"Str2" = "142Z5214GGAAVGA"

In the code, I do:

RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\My Soft", 0,NULL,0,    KEY_READ | KEY_WOW64_64KEY,NULL,&hKey,&dwDis))
/*
Get the value by RegQueryValueEx... 
*/

In a 32-bit Windows is good. In a 64-bit value is empty.

PS: Sorry for my English by Google Translate ^_^

Have you tried HKEY_LOCAL_MACHINE\\Software\\WOW6432Node ?

The default 64-bit version of Registry Editor (Regedit.exe) that is included with 64-bit versions of Windows displays both 64-bit keys and 32-bit keys. The WOW64 registry redirector presents 32-bit programs with different keys for 32-bit program registry entries. In the 64-bit version of Registry Editor, 32-bit keys are displayed under the following registry key.

Source

You say you need to get a value, but you're calling RegCreateKeyEx . Do you actually need to create it? If so, it's probably created in HKLM/Software/Wow6432Node.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM