EvtNext function

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 [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

WinEvt.h

Library

Wevtapi.lib

DLL

Wevtapi.dll

See also

EvtQuery
EvtSeek
EvtSubscribe

 

 

Community Additions

ADD
Show:
© 2014 Microsoft