EvtOpenLog function

Gets a handle to a channel or log file that you can then use to get information about the channel or log file.

Syntax


EVT_HANDLE WINAPI EvtOpenLog(
  _In_ EVT_HANDLE Session,
  _In_ LPCWSTR    Path,
  _In_ DWORD      Flags
);

Parameters

Session [in]

A remote session handle that the EvtOpenSession function returns. Set to NULL to open a channel or log on the local computer.

Path [in]

The name of the channel or the full path to the exported log file.

Flags [in]

A flag that determines whether the Path parameter points to a log file or channel. For possible values, see the EVT_OPEN_LOG_FLAGS enumeration.

Return value

If successful, the function returns a handle to the file or channel; otherwise, NULL. If NULL, call GetLastError function to get the error code.

Remarks

Relative paths and environment variables cannot be used when specifying a file. A Universal Naming Convention (UNC) path can be used to locate the file. Any relative path and environment variable expansion needs to be done prior to making API calls.

To get information about the channel or log file, call the EvtGetLogInfo function.

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

EvtClearLog
EvtExportLog
EvtGetLogInfo

 

 

Show: