Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam

Webinar: Evaluation - 05.12

>
>
WOW6432Node and API-functions RegOpenKe…

WOW6432Node and API-functions RegOpenKeyEx / RegEnumKeyEx

Jan 24 2011
Author:

The register in 64-bit Windows versions is subdivided into 32-bit and 64-bit hives. Most 32-bit hives have the same names as their counterparts in the 64-bit hives and vice versa. By default, 32-bit hives are displayed in the WOW6432Node node in 64-bit Windows versions. The redirection process is transparent for 32-bit applications, i.e. they can access the register hives as if they worked in the 32-bit environment despite the fact that the data are stored in a different place.

This behavior causes issues when 32-bit applications try to access the WOW6432Node node using of Windows API functions (for instance, RegOpenKeyEx and RegEnumKeyEx). When accessing the HKLM\Software\Wow6432Node node, the redirection mechanism is launched and an eternal loop of the "HKLM\Software\Wow6432Node\Wow6432Node\Wow6432Node\... and so on" kind occurs. You might often encounter such errors in various 32-bit register management utilities like, for instance, here.

Beginning with Windows Server 2008, the HKLM\Software\Wow6432Node node is hidden from the RegEnumKeyEx function, although it does not guarantee that an eternal recursion will not occur when trying to directly access this node.

But if you want to work with 64-bit register hives from a 32-bit program, you should open the HKLM\Software node using the KEY_WOW64_64KEY key. But do not try to get a direct access to WOW6432Node and avoid creating new register nodes with the same name.

As an example of an error related to WOW6432Node, consider the defect in a program system consisting of 32-bit and 64-bit units that interact with each other and use different register presentations. The following line in a 32-bit unit stopped working in one program:

lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  "SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources", 0,
  KEY_QUERY_VALUE,  &hKey);

To make this program friends with other 64-bit parts, you should add the KEY_WOW64_64KEY key:

lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  "SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources", 0,
  KEY_QUERY_VALUE | KEY_WOW64_64KEY,  &hKey);

References

Popular related articles


Comments (0)

Next comments next comments
close comment form