I run an XP virtual machine because our ERP app does not run on Vista Business (or any version of Vista). I also use this environment for development work in and around our ERP application. So, today I was installing SQL Server 2005 Express Edition with Advanced Services. Since this includes Reporting Services, I need IIS installed. This is where I ran into trouble. Add/Remove Windows Components would not launch.

When I attempted to launch Add/Remove Windows Components, I received the following error:

Setup library setupqry.dll could not be loaded, or function IndexSrv could not be found.

Contact your system administrator. The specific error code is 0x7e.

The first step in diagnosing this problem was to run Procmon. I saw nothing unusual because all access to setupqry.dll (c:\Windows\System32\Setupqry.dll) was successful. The next step was to use Dependency Walker. Using Procmon, I was able to see the process that reads setupqry.dll, and the command line is:

"C:\WINDOWS\system32\sysocmgr.exe" /y /i:C:\WINDOWS\system32\sysoc.inf

I used Dependency Walker to profile sysocmgr.exe, and sure enough, as part of the log output was:

LoadLibraryExW("C:\WINDOWS\system32\Setup\setupqry.dll", 0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: %1 is not a valid Win32 application (193).

Looks as if the file is corrupt. I went to another XP workstation here in the office, and copied Setupqry.DLL from their machine. When I went to copy the file to my machine, I immediately noticed that in Windows Explorer, the file lacked a description like the other DLLs. Well, I copied over the existing file, and Add/Remove Windows Components opened up like a charm. Crisis avoided; back to DEFCON 2.