-/* $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
}
-VOID // INIT_FUNCTION
+VOID
IopStartBootLog(VOID)
{
IopBootLogCreate = TRUE;
}
-VOID // INIT_FUNCTION
+VOID
IopStopBootLog(VOID)
{
IopBootLogEnabled = FALSE;
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
-CHECKPOINT1;
+ DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
ExReleaseResourceLite(&IopBootLogResource);
return;
}
NULL);
if (!NT_SUCCESS(Status))
{
-CHECKPOINT1;
+ DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
NtClose(ControlSetKey);
ExReleaseResourceLite(&IopBootLogResource);
return;
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);
}
0);
if (!NT_SUCCESS(Status))
{
- CHECKPOINT1;
+ DPRINT1("NtCreateFile() failed (Status %lx)\n", Status);
return Status;
}
sizeof(WCHAR),
&ByteOffset,
NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtWriteKey() failed (Status %lx)\n", Status);
+ }
NtClose(FileHandle);
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;
}
Status = IopWriteLogFile(NULL);
if (!NT_SUCCESS(Status))
{
- CHECKPOINT1;
+ DPRINT1("IopWriteLogFile() failed (Status %lx)\n", Status);
ExReleaseResourceLite(&IopBootLogResource);
return;
}
IopLogFileEnabled = TRUE;
ExReleaseResourceLite(&IopBootLogResource);
- DPRINT1("IopSaveBootLogToFile() done\n");
+ DPRINT("IopSaveBootLogToFile() done\n");
}
-/* $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
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;
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,
}
/*
- * 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);