The procedure entry point SHCreateThreadRef could not be located…

Raymond Chen

Some people smarter than me have been working on this problem, and here’s what they figured out. First, I’ll just reprint their analysis (so that people with the problem and are searching for the solution can find it), and then we can discuss it.

Update (18 October 2005): The official version of this document is now available. Please use that version instead of following the steps below, which were based on a preliminary version of the instructions.

If you receive an error message: “Explorer.EXE – Entry Point Not Found – The procedure entry point SHCreateThreadRef could not be located in the dynamic link library SHLWAPI.dll”, this information will help resolve the issue.

This appears to have been caused by the following sequence of events:

  1. You installed Windows XP Service Pack 2
  2. The installation of Service Pack 2 failed due to a computer crash during the installation which resulted in the automatic Service Pack Recovery process. On next boot, you should have received an error message telling you that the install failed, and that you need to go to the control panel and uninstall SP2 and then try re-installing it. This message may have been dismissed accidentally or by another individual using your computer. In any event, the Service Pack recovery process was not completed by uninstalling the service pack from the Add/Remove Programs control panel, and the system is consequently in a partially installed state which is not stable.
  3. You then installed the latest security update for Windows XP, MS04-038, KB834707. Because your system is still partially SP2, the SP2 version of this fix was downloaded and installed by Windows Update or Automatic Updates. However, the operating system files on the system are the original versions due to the SP Recovery process. This results in mismatched files causing this error.

To recover the system, carefully perform the following steps:

  1. Boot normally and attempt to log in to your desktop. At this point you should get the error message listed above.
  2. Press Control+Alt+Delete at the same time to start the Task Manager. (If you are using classic logon, click the “Task Manager” button.) You may get additional error messages but Task Manager will eventually start.
  3. On the menu bar, select File and then New Task (Run).
  4. Type in control appwiz.cpl into the new task box and hit OK. You may get additional errors that can be ignored.
  5. The Add/Remove Control Panel should now be running. You can close Task Manager.
  6. Near the bottom of the list, find the entry titled “Windows XP Hotfix – KB834707”.
  7. Click on it and click the “Remove” button. It will take some time to complete. Once the “Finish” button is visible, click on it and reboot your system. If you get messages about additional software or hotfixes installed, you can safely ignore them.

Do NOT stop now! Your system is still in the “failed SP2 install” state. You MUST complete the SP2 uninstall, and then re-install SP2.

  1. Start the system and log in.
  2. Click on Start and then Control Panel.
  3. Click on the Add/Remove programs item.
  4. Near the bottom of the list, find the entry titled “Windows XP Service Pack 2”.
  5. Click on it and remove Service Pack 2. You may get a warning about software you have installed after SP2. Make a note of it as you may need to reinstall some of them after the uninstall operation.
  6. After Service Pack 2 has been successfully removed, you should visit http://www.microsoft.com/sp2install for instructions on installing Service Pack 2. You can get SP2 from http://windowsupdate.microsoft.com.
  7. After Service Pack 2 has been successfully re-installed, you should re-visit Windows Update to get the proper version of the latest critical security updates.

FAQ:

Q: I don’t believe I am in the “partially installed SP2” state. Is there any way to check that?

A: After step 7, your system should be able to log in. There are several ways to check.

  1. Open the file c:\windows\svcpack.log, and scroll to the very bottom of the file. About 10 lines from the end, you should see:
    0.xxx: Executing script \SystemRoot\sprecovr.txt
    0.xxx: In cleanup mode. System will not be rebooted.
    
    If you have these lines in svcpack.log, and you did not uninstall Service Pack 2 in Add/Remove Programs, you definitely have a machine in this partially installed state.
  2. Click on the Start button, then Run, and type winver, then click OK. If the version is “Version 5.1 (Build 2600.xpsp_sp2_rtm.040803-2158: Service Pack 2” then you have the correct SP2 install. If, however, it has a number that is less than 040803 after the xpsp2, such as “Build 2600.xpsp2.030422-1633 : Service Pack 2” then you definitely have a machine in the partially installed state. [Corrected typo in version numbering, 11am.]

Notice that the default answer to every dialog box is “Cancel”. The Service Pack setup program detected a problem and gave instructions on how to fix it, and yet people just ignored the message.

The result of not fixing the problem is that you are left with a machine that is neither Service Pack 1 nor Service Pack 2 but instead is a Frankenstein monster of some files from Service Pack 1 and some files from Service Pack 2. This is hardly a good situation. Half the files are mismatched with the other half.

There was enough of Service Pack 2 on your machine that Windows Update downloaded the Service Pack 2 version of the security patch and tried to install it. This made a bad situation worse.

What’s the moral of the story?

First, that users ignore all error messages. Even error messages that tell how to fix the error! Second, that ignoring some error messages often leads to worse error messages. And third, that once you get into this situation, you’re off in uncharted territory. And there are only dragons there.

(These are the types of problems that are nearly impossible to debug: It will never happen in the test lab, because the test lab people know that when an error message tells you, “The install failed; you need to do XYZ to fix it,” you should do it! All you can work from are descriptions from people who are having the problem, and a lot of creativity to try to guess “What happened that they aren’t telling me?”)

0 comments

Discussion is closed.

Feedback usabilla icon