Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agent/wua_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,15 @@ func (s *IUpdateSession) GetWUAUpdateCollection(query string) (*IUpdateCollectio
searcher := searcherRaw.ToIDispatch()
defer searcher.Release()

// The IUpdateSearcher::IncludePotentiallySupersededUpdates method sets whether the
// results include updates that are superseded by other updates in the search results.
// This default to true so agent reports missing patches that have been superseded by newer patch versions/revisions.
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-uamg/b3521681-cc20-419a-87d2-b0dc7ae2b9ff
_, err = searcher.PutProperty("IncludePotentiallySupersededUpdates", false)
if err != nil {
return nil, fmt.Errorf("error setting IncludePotentiallySupersededUpdates: %v", err)
}

// returns ISearchResult
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa386077(v=vs.85).aspx
resultRaw, err := searcher.CallMethod("Search", query)
Expand Down