title: Exception from HRESULT: 0x80240007 when querying Windows Updates
body: <p>I am getting the error &quot;Exception from HRESULT: 0x80240007&quot; when I am trying to fetch the installed Windows updates. My code worked well in Windows 7, but it's not working in Windows XP. I am getting the error in the line <code>var history = updateSearcher.QueryHistory(0, count);</code></p>
  <p>This is my code snippet:</p>
  <pre><code>        var updateSession = new UpdateSession();
          var updateSearcher = updateSession.CreateUpdateSearcher();
          var count = updateSearcher.GetTotalHistoryCount();
          var history = updateSearcher.QueryHistory(0, count);
  </code></pre>
  <p>What changes do I need to make in the code?</p>