Apart from the MSDN reference, I want to know what these keys do? Does KEY_WOW64_32KEY means that a 32-bit app on x64 OS will access the WOW64 Registry Tree ? And does KEY_WOW64_64KEY means that a 32-bit app on x64 OS will access the normal Registry Tree and not the WOW64 Registry Tree ? What if I have to access some keys which I do not know whether lies in the WOW64 or normal Registry Tree ?
2 Answers
KEY_WOW64_64KEY
on a 64-bit OS means that the registry access, no matter if it's a 32 or 64 bit process, will access the 64 bit registry view.KEY_WOW64_32KEY
on a 64-bit OS means that the registry access, no matter if it's a 32 or 64 bit process, will access the 32 bit registry view.Neither of them have any effect on a 32-bit OS.
Leaving the flag out (the default) on a 64-bit OS will send registry accesses from 32-bit processes to the 32 bit registry view, and accesses from 64-bit processes to the 64 bit registry view.
For more info, this reference page at Microsoft should tell the whole tale.

- 176,943
- 25
- 281
- 294
-
According to the reference you have provided, RegDeleteKey can not be used to access the alternate registry hive. What if platform = x64, app = x86, RegOpenKeyEx with samDesired as KEY_WOW64_64KEY and I pass the handle of the opened 64Key to RegDeleteKey, would it delete the specified key then? – Oct 09 '12 at 09:57
-
1@user1696837 Yes, if you have an already opened HKEY to the 64-bit registry, RegDeleteKey will work (for now). If that's guaranteed to be the case in the future, I don't know, the recommended way would definitely be RegDeleteKeyEx with the `KEY_WOW64_64KEY` flag. – Joachim Isaksson Oct 09 '12 at 10:18
From the linked reference:
For more information, see Accessing an Alternate Registry View.
Which says:
KEY_WOW64_64KEY: Access a 64-bit key from either a 32-bit or 64-bit application.
KEY_WOW64_32KEY: Access a 32-bit key from either a 32-bit or 64-bit application.

- 21,757
- 2
- 39
- 47
-
According to the reference you have provided, RegDeleteKey can not be used to access the alternate registry hive. What if platform = x64, app = x86, RegOpenKeyEx with samDesired as KEY_WOW64_64KEY and I pass the handle of the opened 64Key to RegDeleteKey, would it delete the specified key then? – Oct 09 '12 at 09:57