BOOL ClearEventLog(hEventLog, lpszBackupFile) | |||||
HANDLE hEventLog; | /* event-log handle (returned by OpenEventLog) | */ | |||
LPTSTR lpszBackupFile; | /* name of the backup file | */ |
The ClearEventLog function clears an event log, and optionally saves the current copy of the log file in a backup file.
hEventLog
Specifies the event-log handle. This handle is returned by the OpenEventLog function.
lpszBackupFile
Points to the null-terminated string specifying the name of a file where a current copy of the event-log file will be placed. If this file already exists, the function will fail.
If lpszBackupFile is NULL, the current event-log file is not backed up.
If the function is successful, the return value is TRUE. The event log has been backed up and the current log for the module has been cleared.
If the function fails, the return value is FALSE. Use the GetLastError function to obtain extended error information.
This function is used to optionally back up an existing log file of the module represented by hEventLog to another file and clear it. The caller must have write permission for the path specified, and must also have permission to move the current log file. If a file already exists with the same name as lpszBackupFile, this operation will fail.
OpenEventLog