1 out of 1 rated this helpful - Rate this topic

EvtNext function

Applies to: desktop apps only

Gets the next event from the query or subscription results.

Syntax

BOOL WINAPI EvtNext(
  __in   EVT_HANDLE ResultSet,
  __in   DWORD EventArraySize,
  __in   EVT_HANDLE* EventArray,
  __in   DWORD Timeout,
  __in   DWORD Flags,
  __out  PDWORD Returned
);

Parameters

ResultSet [in]

The handle to a query or subscription result set that the EvtQuery function or the EvtSubscribe function returns.

EventArraySize [in]

The number of elements in the EventArray array. The function will try to retrieve this number of elements from the result set.

EventArray [in]

A pointer to an array of handles that will be set to the handles to the events from the result set.

Timeout [in]

The number of milliseconds that you are willing to wait for a result. Set to INFINITE to indicate no time-out value. If the time-out expires, the last error is set to ERROR_TIMEOUT.

Flags [in]

Reserved. Must be zero.

Returned [out]

The number of handles in the array that are set.

Return value

Return code/valueDescription
TRUE

The function succeeded.

FALSE

The function failed. To get the error code, call the GetLastError function.

 

Remarks

Call this function in a loop until the function returns FALSE and the error code is ERROR_NO_MORE_ITEMS.

For each event that you retrieve, you can then call the EvtCreateRenderContext and EvtRender functions to render the event.

You must call EvtClose on each event handle that you receive.

Examples

For an example that shows how to use this function, see Querying for Events and Subscribing to Events.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WinEvt.h

Library

Wevtapi.lib

DLL

Wevtapi.dll

See also

EvtQuery
EvtSeek
EvtSubscribe

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ