Export (0) Print
Expand All

IUpdateSession3::QueryHistory method

Synchronously queries the computer for the history of update events. This method method returns a pointer to an IUpdateHistoryEntryCollection interface that contains matching event records on the computer.

Syntax


HRESULT QueryHistory(
  [in]   BSTR criteria,
  [in]   LONG startIndex,
  [in]   LONG count,
  [out]  IUpdateHistoryEntryCollection **retval
);

Parameters

criteria [in]

A string that specifies the search criteria.

startIndex [in]

The index of the first event to retrieve.

count [in]

The number of events to retrieve.

retval [out]

A pointer to an IUpdateHistoryEntryCollection interface that contains the matching event records on the computer in descending chronological order.

Return value

Returns S_OK if successful. Otherwise, returns a COM or Windows error code.

This method can also return the following error codes.

Return codeDescription
E_POINTER

A parameter value is invalid or NULL.

WU_E_INVALID_CRITERIA

There is an invalid search criteria.

 

Remarks

The collection of events that is returned is sorted by the date in descending order.

The string that is used for the criteria parameter must match the custom search language for QueryHistory. The string contains criteria that are evaluated to determine which history events to return.

Note that QueryHistory supports per-machine updates only.

For a complete description of search criteria syntax, see Search.

The following table identifies all the public support criteria, in the order of evaluation precedence. More criteria may be added to this list in the future.

CriterionTypeAllowed operatorsDescription
UpdateIDstring(UUID)=

Finds updates that have an UpdateIdentity.UpdateID of the specified value.

For example, "UpdateID='12345678-9abc-def0-1234-56789abcdef0'" finds updates for UpdateIdentity.UpdateID that equal 12345678-9abc-def0-1234-56789abcdef0.

 

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional with SP3 [desktop apps only]

Minimum supported server

Windows Server 2003, Windows 2000 Server with SP3 [desktop apps only]

Header

Wuapi.h

IDL

Wuapi.idl

Library

Wuguid.lib

DLL

Wuapi.dll

See also

IUpdateSession3

 

 

Community Additions

ADD
Show:
© 2014 Microsoft