Wuapi.dll Search() not returning all updates

294 views Asked by At

Testing the functions of wuapi.dll I noticed that some updates are not listed in the results (obviously because they are visible from the update manager).

Code used(c#):

        public ISearchResult CheckUpdates()
        {
          IUpdateSearcher uSearcher = uSession.CreateUpdateSearcher();
          uSearcher.Online = true;
          ISearchResult uResult = uSearcher.Search("Type='Software' and IsInstalled=0");
          return uResult;
        }

Also tried all possible filters combination.

Update Manager Screenshot Update Manager Screenshot

Anyone knows why? Thanks.

2

There are 2 answers

1
SamK On

Try adding this:

uSearcher.ServerSelection = ServerSelection.ssOthers;
uSearcher.ServiceID = "7971f918-a847-4430-9279-4a52d1efe18d";

And leave out the Type='Software' like Theo said.

0
t.mod On

Finally I found the right filter that worked for me: IsInstalled = 0 And DeploymentAction=*