Just like how files are redirected by WoW64, registry accesses are also redirected
The registry redirector isolates 32-bit and 64-bit applications by providing separate logical views of certain portions of the registry on WOW64. The registry redirector intercepts 32-bit and 64-bit registry calls to their respective logical registry views and maps them to the corresponding physical registry location. The redirection process is transparent to the application. Therefore, a 32-bit application can access registry data as if it were running on 32-bit Windows even if the data is stored in a different location on 64-bit Windows.
Registry Redirector
You need to specify KEY_WOW64_64KEY
on the samDesired
parameter when accessing 64-bit registry keys with RegCreateKeyEx
, RegDeleteKeyEx
or RegOpenKeyEx
The following flags enable 32-bit applications to access redirected keys in the 64-bit registry view and 64-bit applications to access redirected keys in the 32-bit registry view. These flags have no effect on shared registry keys. For more information, see Registry Keys Affected by WOW64.
Flag name |
Value |
Description |
KEY_WOW64_64KEY |
0x0100 |
Access a 64-bit key from either a 32-bit or 64-bit application. |
KEY_WOW64_32KEY |
0x0200 |
Access a 32-bit key from either a 32-bit or 64-bit application. Windows 10 on ARM: This refers to the 32-bit ARM registry view for 32-bit ARM processes and the 32-bit x86 registry view for 32-bit x86 and 64-bit ARM64 processes. |
Accessing an Alternate Registry View
However I think compiling the program in separate 32 and 64-bit versions will be easier. Most programs don't need to change when recompile. Moreover you'll still have to recompile the shell extension because 64-bit processes can't load 32-bit DLLs