home · blog · groups · about us · contact us
DevelopmentNow Blog
 Tuesday, October 11, 2005
 
 

If you have a 32 bit application uses custom registry values (e.g. HKLM/Software/MyApp/MySetting), it might have problems accessing those keys when run on 64-bit Windows. That's because 64-bit Windows (via WOW64, the 32-bit emulator that runs on 64-bit Windows) has separate sections in the registry for 32-bit apps and 64-bit apps. So when run on 64-bit windows, if a 32-bit app is looking for

HKLM/Software/MyApp/MySetting

it actually needs to look in

HKLM/Software/WOW6432Node/MyApp/MySetting

when running on 64-bit Windows.

If you want to use the same key location regardless of which OS you're running, you need to enable registry reflection (or registry mirroring) for the keys you're interested in. WOW64 uses registry reflection to store certain keys in both the 32-bit and 64-bit registry sections. This allows 32-bit and 64-bit applications to share the same set of registry keys, and allows your application to use the same key on 32-bit and 64-bit Windows. A number of keys are reflected by default (e.g. HKLM/Software/Classes, a bunch of stuff under HKLM/Software/Microsoft), but you can use the RegEnableReflectionKey function to ask the OS to provide reflection for any key you need shared between 32-bit & 64-bit code (for example, our friend HKLM/Software/MyApp/MySetting).

More info:

http://support.microsoft.com/?kbid=305097

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/registry_reflection.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/running_32_bit_applications.asp

 

 

OS
October 11, 2005    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]

Related posts:
Securing Remote Desktop with SSL
Installing Webmin on Godaddy VDS
HTTP Compression in IIS
Are Virtual Servers Right for Your Applications?
Slipstream Windows the Easy Way Using NLite
Insufficient System Resources Exist to Complete the API


« Terminal Services / Remote Desktop Extra... | Main | MSDN License Fees and Empower ISV »
Comments are closed.