IUpdateSession3::QueryHistory method (wuapi.h)

Synchronously queries the computer for the history of update events. This 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

[in] criteria

A string that specifies the search criteria.

[in] startIndex

The index of the first event to retrieve.

[in] count

The number of events to retrieve.

[out] retval

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 code Description
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.

Criterion Type Allowed operators Description
UpdateID string(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

Requirement Value
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]
Target Platform Windows
Header wuapi.h
Library Wuguid.lib
DLL Wuapi.dll

See also

IUpdateSession3