views:

514

answers:

2

In our vc++ win32 application we are reading a registry value of type reg_multi_sz, its working fine on 32-bit but giving empty buffer when i ran on 64- bit. How can I read values of 64 bit registry from my 32-bit application ?

A: 

Try the sample code listed on the following help article. It's written specifically for reading REG_MULTI_SZ values.

JaredPar
thanks for giving the example
+1  A: 

Could you be more specific? Usually when your try to read 64-bit registry hive in 32-bit code you must open HKLM\Software using KEY_WOW64_64KEY. Hope that helps.

iaimtomisbehave
Thank you so much using this KEY_WOW64_64KEY access right its working fine onn 32 and 64 bit registry.
But want to know a bit more on this can you pls give why it failed before?
On 64 bit version of Windows parts of the registry are stored seperately for 32-bit apps and 64 bit apps. KEY_WOW64_64KEY will enable explicit access to the 64-bit view. Unless I look at more of your code I won't be able tell exactly why it failed in the first place. But this hopefully gives you enough information to figure that out.
iaimtomisbehave
Ok thank you. I got why it failed before. I observed that if we open registry using RegOpenEx() then by default it opens 32 -bit registry view.