KEY_WOW64_32KEY and KEY_WOW64_64KEY
Asked Answered
A

2

13

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 ?

Alecalecia answered 9/10, 2012 at 9:14 Comment(0)
A
32
  • 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.

Asco answered 9/10, 2012 at 9:23 Comment(2)
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?Alecalecia
@Alecalecia 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.Asco
P
2

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.

Palliate answered 9/10, 2012 at 9:24 Comment(1)
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?Alecalecia

© 2022 - 2024 — McMap. All rights reserved.