Weird issues when msxml3.dll fails

  • Symptoms
  • I’ve recently had the following symptoms on a computer:

    • Clicking on ‘properties’ after right click on ‘computer’ in the start menu doesn’t do anything

      computer-properties

    • I cannot launch eventvwr.msc or eventvwr.exe without getting an error message although I can launch mmc.exe and load the snap-in successfully to read the eventlogs
      mmc-fail
    • Opening the Windows Update applet from the Control Panel doesn’t work
    • the AV UI fails
      AV-fails
    • The volume shadow copy service complains all the time
      Volume Shadow Copy Service error: Unexpected error calling routine CoCreateInstance. hr = 0x80040154, Class not registered

      VSS-2

    • The servicing stack is idle and running the System Update Readiness tool to fix Windows corruption errors fails with the following error message:
      Windows update could not be installed because of error 2147746132 “Class not registered”
      wusa-fails

      wusa-fails-2
      NB: I can still extract what’s in the Windows6.1-KB947821-v34-x64.msu file and run checksur.exe manually.

  • More clues
    • The WindowsUpdate.log file indicates:
      WU-log
    • The volume shadow copy service also reports
      VSS-1
    • and clicking “manage” after right-clicking ‘computer in the start menu ends with the following error message:
      msxml3.dll is either not designed to run on Windows or it contains an error
      msxml-error
  • What’s the problem
  • Everything says msxml3.dll has a problem. Right?

  • What’s the root cause
    • The msxml3.dll is actually empty:
      msxml-error-2
    • and the CBS logs says, it started applying a package supposed to replace msxml3.dll
      CBS-1
    • but 2 minutes later, it reported it cannot parse XML anymore
      CBS-2
    • What happened during these 2 minutes….is actually a power loss 😦
      loss-power
  • My fix
  • # Gather all msxml3.dll files under %windir%
    $all = dir C:\Windows\* -inc msxml3.dll -rec -for -ea 0
    # restore the most recent version from the component store
    robocopy ($all | Where { $_.FullName -match "amd64" } | sort lastwritetime | Select -Last 1).Directory C:\Windows\system32  msxml3.dll /B
    # register the dll
    regsvr32 C:\Windows\system32\msxml3.dll
    # if that fails, try with the n-1 version
    robocopy ($all |
    Where { $_.FullName -match "amd64" } |
    sort lastwritetime |
    Select -last 2)[0].Directory C:\Windows\system32  msxml3.dll /B
    regsvr32 C:\Windows\system32\msxml3.dll
    
  • Steps to reproduce the problem
  • # unregister the dll
    regsvr32 /u C:\Windows\system32\msxml3.dll
    # create an empty file
    New-Item C:\Windows\temp -Name msxml3.dll -ItemType File
    # stop services that lock msxml3.dll
    Stop-Service -Name WSearch,WinRM -Verbose
    # kill processes that lock msxml3.dll
    taskkill /im explorer* /f
    # restore the file (ab)using the backup privilege
    robocopy C:\Windows\temp c:\windows\system32 msxml3.dll /r:0 /B
    
    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s