Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.26 KB

ClearEventLog.md

File metadata and controls

57 lines (37 loc) · 1.26 KB

Home

Function name : ClearEventLog

Group: Event Logging - Library: advapi32


Clears the specified event log, and optionally saves the current copy of the log to a backup file.


Code examples:

Reading entries from Event logs

Declaration:

BOOL ClearEventLog(
  HANDLE hEventLog,
  LPCTSTR lpBackupFileName
);  

FoxPro declaration:

DECLARE INTEGER ClearEventLog IN advapi32;
	INTEGER hEventLog,;
	STRING lpBackupFileName  

Parameters:

hEventLog [in] A handle to the event log to be cleared. This handle is returned by the OpenEventLog function.

lpBackupFileName [in] The name of the backup file. If this file already exists, the function fails. If the lpBackupFileName parameter is NULL, the current event log is not backed up.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

The ClearEventLog function fails if the event log is empty or a file already exists with the same name as lpBackupFileName.

After this function returns, any handles that reference the cleared event log cannot be used to read the log.