Today I needed to install some software on a web server. This software is an ASP application, is in VBScript, using some VB6 DLLs. I don’t know much about what goes on internally - my job was simply to get it up and running on a new remote server.

I thought I was doing quite well, despite my lack of intimate knowledge of IIS 6 (this is an x64 2003 box), but I fell at the last hurdle. The main page wouldn’t appear fully. As it didn’t give an error message, I assumed that it must be having a problem talking to the SQL Server database and wrote a small utility in VB6 to show whether a particular connection string would work. It did.

I thought I’d try and get more clues as to what was going wrong, so I started to delve into the .asp files. Soon, I noticed that they should be giving me error messages and discovered that there was an error message and a stack trace in the HTML. It wasn’t visible in the browser because it was in the wrong place in the HTML, but it helped.

The stack trace showed that there was a problem opening a registry key, but the developer hadn’t thought to include the actual error code or message, so the reason was left up to me to discover.

To begin with, I assumed it would be a permissions problem on the particular branch of the registry the application uses. I checked the permissions on the other server we have this installed on - they appeared to be the same.

After scratching my head for some time, I decided I needed yet more information. I found the source to the COM DLLs and added error code reporting to the message about being unable to read a registry key. When I got this (it was 2), a web search for ‘regopenkeyex 2’ showed me what I needed.

Those who have had anything to do with 64 bit Windows will probably laugh at me, but I’d never heard of Wow6432Node. It seems that 32 bit applications don’t read from the part of the registry they normally would (in 32 bit Windows). When they try to read from HKLM\Software\X, they are silently redirected to HKLM\Software\Wow6432Node\X.

When I had earlier imported a .reg file, the entries had been put in the wrong place. I would have thought it might be nice to add a message to regedit in Windows x64, to warn you that importing might not put things in the correct location.

That’s over an hour I’ll never get back. Thanks again Microsoft.

No comments