From 5192d67c43cd76de8c63c409c8b1a3cdae63fb3e Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 20 Jan 2014 21:32:49 +0000 Subject: [PATCH] [EVENTLOG] LogfClearFile: Write the backup file and add status checks. svn path=/trunk/; revision=61742 --- reactos/base/services/eventlog/file.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/reactos/base/services/eventlog/file.c b/reactos/base/services/eventlog/file.c index b0e80a2fa24..75ba6946374 100644 --- a/reactos/base/services/eventlog/file.c +++ b/reactos/base/services/eventlog/file.c @@ -1099,18 +1099,31 @@ NTSTATUS LogfClearFile(PLOGFILE LogFile, PUNICODE_STRING BackupFileName) { + NTSTATUS Status; + RtlAcquireResourceExclusive(&LogFile->Lock, TRUE); if (BackupFileName->Length > 0) { - /* FIXME: Write a backup file */ + /* Write a backup file */ + Status = LogfBackupFile(LogFile, + BackupFileName); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LogfBackupFile failed (Status: 0x%08lx)\n", Status); + return Status; + } } - LogfInitializeNew(LogFile); + Status = LogfInitializeNew(LogFile); + if (!NT_SUCCESS(Status)) + { + DPRINT1("LogfInitializeNew failed (Status: 0x%08lx)\n", Status); + } RtlReleaseResource(&LogFile->Lock); - return STATUS_SUCCESS; + return Status; }