Friday, August 24, 2012

WOW64 – WebApps

In a recent project I had to migrate some complex (this is relative) WebApps to a 64bits Windows Server 2008 R2. I'm not a "SysAdmin" (not close), but... work is work! The main issue is that we're talking about 32 bits ASP.NET 1.1 applications that use the WindowsRegistry. When you merge a registry file that was created for WS2000 with the registry of a WS2008 64bits server (say MyKey.reg), the keys are actually created in the "normal" hive.

However, a 32 bits ASP.NET application will not find this key (e.g.: Using Registry.LocalMachine.OpenSubKey). Due to the WOW64 (WindowsOnWindows64) feature, a Registry Redirection (more info below) takes place and it will look for the key in a special hive: Wow6432Node. Meaning, the key you want must exist in this hive:

This problem also comes in "different flavors": %SystemRoot%\\SysWOW64 instead of the usual   %SystemRoot%\\System32, ODBC drivers (%SystemRoot%\\SysWOW64\\odbcad32.exe), OLEDB... on and on and on...

@MSDN: "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." More info HERE and HERE;