Issue with IUpdateHistoryEntry2 interface

Saurabh Srivastava 0 Reputation points
2024-11-17T18:30:10.42+00:00

Trying to get category Ids for the installed updates on the machine.
From IUpdateHistoryEntry2 we get ICategoryCollection. Which provides ICategory object on iteration.
Calling get_CategoryId always returns empty.

Try the same through ICategoryCollection obtained from IUpdate interface (Using IUpdateSearcher and required criteria) for the same updates we are able to get categoryId

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,666 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 45,706 Reputation points
    2024-11-18T12:43:14.7+00:00

    I don't work for Microsoft and so don't have visibility into the internals of the WUAPI. However, based on my own tests on a fully updated Windows 10 22H2 system I observe that there is not symmetry between the information returned when querying installed updates compared to the update history.

    For example, the installed update information for the most recent Cumulative update was

    2024-11 Cumulative Update for Windows 10 Version 22H2 for x64-based Systems (KB5046613)
    	Published 11/12/2024
    	UpdateID - fde97ff5-d39e-4de3-b176-d2aaf7481189, Revision 1, Category collection count: 1 items
    	CategoryId: 0fa1201d-4330-4fa8-8ae9-b877473b6441, CategoryName: Security Updates, CategoryType: UpdateClassification
    	No CVE Information available
    

    However, the information returned from Windows Update History was

    2024-11 Cumulative Update for Windows 10 Version 22H2 for x64-based Systems (KB5046613)
    	Date 11/12/2024
    	UpdateID - fde97ff5-d39e-4de3-b176-d2aaf7481189, Revision 1, Category collection count: 0 items
    

    Note that the updated history did not contain any category information at all.

    From the installed update information for the most recent .Net Framework cumulative update -

    2024-11 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 22H2 for x64 (KB5046542)
    	Published 11/12/2024
    	UpdateID - 3680cb4d-c9c3-4bbf-81d6-f9839d9822fc, Revision 200, Category collection count: 2 items
    	CategoryId: cd5ffd1e-e932-4e3a-bf74-18bf0b1bbd83, CategoryName: Updates, CategoryType: UpdateClassification
    	CategoryId: b3c75dc1-155f-4be4-b015-3f1a91758e52, CategoryName: Windows 10, version 1903 and later, CategoryType: Product
    	No CVE Information available
    

    And the information returned from the Windows Update History was

    2024-11 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Windows 10 Version 22H2 for x64 (KB5046542)
    	Date 11/12/2024
    	UpdateID - 3680cb4d-c9c3-4bbf-81d6-f9839d9822fc, Revision 200, Category collection count: 1 items
    	CategoryId: (null), CategoryName: Windows 10, version 1903 and later, CategoryType: Product
    

    In this case the history entry category name and category type were in agreement but there was no information for the category id for the single category that was present in the both the history and installed updates information.

    So my observation is that it is just an assumption that symmetry between these two different sources of information exists. I don't believe that language issues are relevant.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.