- Print correct ReactOS version in the boot log header.
authorEric Kohl <eric.kohl@reactos.org>
Fri, 24 Sep 2004 10:51:35 +0000 (10:51 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 24 Sep 2004 10:51:35 +0000 (10:51 +0000)
- Add ntoskrnl.exe and hal.dll to the boot log.

svn path=/trunk/; revision=11024

reactos/ntoskrnl/io/bootlog.c
reactos/ntoskrnl/io/driver.c

index 95c46f6..cb97cb3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bootlog.c,v 1.1 2004/09/23 11:26:41 ekohl Exp $
+/* $Id: bootlog.c,v 1.2 2004/09/24 10:51:35 ekohl Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -32,7 +32,7 @@ IopInitBootLog(VOID)
 }
 
 
-VOID // INIT_FUNCTION
+VOID
 IopStartBootLog(VOID)
 {
   IopBootLogCreate = TRUE;
@@ -40,7 +40,7 @@ IopStartBootLog(VOID)
 }
 
 
-VOID // INIT_FUNCTION
+VOID
 IopStopBootLog(VOID)
 {
   IopBootLogEnabled = FALSE;
@@ -90,7 +90,7 @@ IopBootLog(PUNICODE_STRING DriverName,
                     &ObjectAttributes);
   if (!NT_SUCCESS(Status))
     {
-CHECKPOINT1;
+      DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
       ExReleaseResourceLite(&IopBootLogResource);
       return;
     }
@@ -110,7 +110,7 @@ CHECKPOINT1;
                       NULL);
   if (!NT_SUCCESS(Status))
     {
-CHECKPOINT1;
+      DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
       NtClose(ControlSetKey);
       ExReleaseResourceLite(&IopBootLogResource);
       return;
@@ -126,14 +126,15 @@ CHECKPOINT1;
   NtClose(BootLogKey);
   NtClose(ControlSetKey);
 
-  if (NT_SUCCESS(Status))
+  if (!NT_SUCCESS(Status))
     {
-      IopLogEntryCount++;
+      DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
     }
   else
     {
-CHECKPOINT1;
+      IopLogEntryCount++;
     }
+
   ExReleaseResourceLite(&IopBootLogResource);
 }
 
@@ -271,7 +272,7 @@ IopCreateLogFile(VOID)
                        0);
   if (!NT_SUCCESS(Status))
     {
-      CHECKPOINT1;
+      DPRINT1("NtCreateFile() failed (Status %lx)\n", Status);
       return Status;
     }
 
@@ -287,6 +288,10 @@ IopCreateLogFile(VOID)
                       sizeof(WCHAR),
                       &ByteOffset,
                       NULL);
+  if (!NT_SUCCESS(Status))
+    {
+      DPRINT1("NtWriteKey() failed (Status %lx)\n", Status);
+    }
 
   NtClose(FileHandle);
 
@@ -311,22 +316,22 @@ IopSaveBootLogToFile(VOID)
   if (IopBootLogCreate == FALSE)
     return;
 
-  DPRINT1("IopSaveBootLogToFile() called\n");
+  DPRINT("IopSaveBootLogToFile() called\n");
 
   ExAcquireResourceExclusiveLite(&IopBootLogResource, TRUE);
 
   Status = IopCreateLogFile();
   if (!NT_SUCCESS(Status))
     {
-      CHECKPOINT1;
+      DPRINT1("IopCreateLogFile() failed (Status %lx)\n", Status);
       ExReleaseResourceLite(&IopBootLogResource);
       return;
     }
 
-  Status = IopWriteLogFile(L"ReactOS 0.2.4");
+  Status = IopWriteLogFile(L"ReactOS "KERNEL_VERSION_STR);
   if (!NT_SUCCESS(Status))
     {
-      CHECKPOINT1;
+      DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);
       ExReleaseResourceLite(&IopBootLogResource);
       return;
     }
@@ -334,7 +339,7 @@ IopSaveBootLogToFile(VOID)
   Status = IopWriteLogFile(NULL);
   if (!NT_SUCCESS(Status))
     {
-      CHECKPOINT1;
+      DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);
       ExReleaseResourceLite(&IopBootLogResource);
       return;
     }
@@ -416,7 +421,7 @@ IopSaveBootLogToFile(VOID)
   IopLogFileEnabled = TRUE;
   ExReleaseResourceLite(&IopBootLogResource);
 
-  DPRINT1("IopSaveBootLogToFile() done\n");
+  DPRINT("IopSaveBootLogToFile() done\n");
 }
 
 
index 1ba9d98..6d745cd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: driver.c,v 1.53 2004/09/23 11:26:41 ekohl Exp $
+/* $Id: driver.c,v 1.54 2004/09/24 10:51:35 ekohl Exp $
  *
  * COPYRIGHT:      See COPYING in the top level directory
  * PROJECT:        ReactOS kernel
@@ -1189,7 +1189,7 @@ IopInitializeBootDrivers(VOID)
    DPRINT("IopInitializeBootDrivers()\n");
 
    BootDriverCount = 0;
-   for (i = 2; i < KeLoaderBlock.ModsCount; i++)
+   for (i = 0; i < KeLoaderBlock.ModsCount; i++)
    {
       ModuleStart = KeLoaderModules[i].ModStart;
       ModuleSize = KeLoaderModules[i].ModEnd - ModuleStart;
@@ -1199,26 +1199,21 @@ IopInitializeBootDrivers(VOID)
       if (Extension == NULL)
          Extension = "";
 
-      /*
-       * Pass symbol files to kernel debugger
-       */
-
       if (!_stricmp(Extension, ".sym"))
       {
+         /* Pass symbol files to kernel debugger */
          KDB_SYMBOLFILE_HOOK((PVOID)ModuleStart, ModuleName, ModuleSize);
-      } else
-
-      /*
-       * Load builtin driver
-       */
-      if (!_stricmp(Extension, ".exe") || !_stricmp(Extension, ".dll"))
+      }
+      else if (!_stricmp(Extension, ".exe") || !_stricmp(Extension, ".dll"))
       {
+        /* Log *.exe and *.dll files */
         RtlCreateUnicodeStringFromAsciiz(&DriverName, ModuleName);
         IopBootLog(&DriverName, TRUE);
         RtlFreeUnicodeString(&DriverName);
       }
       else if (!_stricmp(Extension, ".sys"))
       {
+         /* Initialize and log boot start driver */
          if (!ModuleLoaded)
          {
             Status = IopInitializeBuiltinDriver(NULL,
@@ -1233,16 +1228,14 @@ IopInitializeBootDrivers(VOID)
       }
 
       /*
-       * Free memory for all boot files, except ntoskrnl.exe and hal.dll
+       * Free memory for all boot files, except ntoskrnl.exe, hal.dll
+       * and symbol files, if the kernel debugger is active
        */
-
+      if (_stricmp(Extension, ".exe") && _stricmp(Extension, ".dll")
 #ifdef KDBG
-      /*
-       * Do not free the memory from symbol files, if the kernel debugger
-       * is active
-       */
-      if (_stricmp(Extension, ".sym"))
+          && _stricmp(Extension, ".sym")
 #endif
+         )
       {
          MiFreeBootDriverMemory((PVOID)KeLoaderModules[i].ModStart,
             KeLoaderModules[i].ModEnd - KeLoaderModules[i].ModStart);