Good day, all.
I come into collsion with searches via WUA API. Please help me to resolve
this issue.
I get accessible updates with help the following code:
.........
IUpdateSession* pSession = NULL;
HRESULT hr = ::CoCreateInstance(CLSID_UpdateSession, NULL,
CLSCTX_LOCAL_SERVER, IID_IUpdateSession, (void**)&pSession);
IUpdateSearcher* pSearcher = NULL;
hr = pSession->CreateUpdateSearcher(&pSearcher);
BSTR bstrSearchCriteria = L"IsInstalled=0 and Type='Software'";
ISearchResult* pSearchResult = NULL;
hr = pSearcher->Search(bstrSearchCriteria, &pSearchResult);
IUpdateCollection* pUpdateCollection = NULL;
hr = pSearchResult->get_Updates(&pUpdateCollection);
..........
Next, i save the identity (UpdateID) property for one element from
collection. Then i write a new program. That program is identically with
previous with the exception of the search string. Now i use the following:
BSTR bstrCriteria = L"UpdateID='6f5dc828-0f05-4577-9a8a-74ab1cbe00a9'";
(GUID is previously saved UpdateID).
I think that get_Updates method will return 1 element on basis of that
criteria. But when i check number of elements by get_Count method, I take
number of elements as in previously programm, not 1.
What i do wrong?
Best regards, Vadim
>> Stay informed about: Search problem with WUA API.