[EVENTLOG]
authorEric Kohl <eric.kohl@reactos.org>
Mon, 20 Jan 2014 21:32:49 +0000 (21:32 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 20 Jan 2014 21:32:49 +0000 (21:32 +0000)
LogfClearFile: Write the backup file and add status checks.

svn path=/trunk/; revision=61742

reactos/base/services/eventlog/file.c

index b0e80a2..75ba694 100644 (file)
@@ -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;
 }