Separate import of system and hardware hive.

svn path=/trunk/; revision=4396
This commit is contained in:
Eric Kohl 2003-03-22 18:27:40 +00:00
parent c5b283562d
commit 5aa85e8ac2
3 changed files with 53 additions and 34 deletions

View file

@ -1,4 +1,4 @@
/* $Id: import.c,v 1.10 2002/11/10 14:00:41 robd Exp $
/* $Id: import.c,v 1.11 2003/03/22 18:26:53 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -19,6 +19,7 @@
#include <string.h>
#include <internal/pool.h>
#include <internal/registry.h>
#include <internal/ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
@ -490,8 +491,8 @@ setKeyValue (HANDLE currentKey,
}
VOID
CmImportHive(PCHAR ChunkBase,
ULONG ChunkSize)
CmImportTextHive(PCHAR ChunkBase,
ULONG ChunkSize)
{
HANDLE currentKey = INVALID_HANDLE_VALUE;
int newKeySize;
@ -612,3 +613,29 @@ CmImportHive(PCHAR ChunkBase,
}
VOID
CmImportSystemHive(PCHAR ChunkBase,
ULONG ChunkSize)
{
if (strncmp (ChunkBase, "REGEDIT4", 8) == 0)
{
DPRINT("Found 'REGEDIT4' magic\n");
CmImportTextHive (ChunkBase, ChunkSize);
}
else
{
DPRINT1("Found '%*s' magic\n", 4, ChunkBase);
KeBugCheck(0);
}
}
VOID
CmImportHardwareHive(PCHAR ChunkBase,
ULONG ChunkSize)
{
DPRINT1("CmImportHardwareHive() called\n");
}
/* EOF */

View file

@ -45,7 +45,8 @@ VOID PsInit(VOID);
VOID CmInitializeRegistry(VOID);
VOID CmInit2(PCHAR CommandLine);
VOID CmShutdownRegistry(VOID);
VOID CmImportHive(PCHAR ChunkBase, ULONG ChunkSize);
VOID CmImportSystemHive(PCHAR ChunkBase, ULONG ChunkSize);
VOID CmImportHardwareHive(PCHAR ChunkBase, ULONG ChunkSize);
VOID KdInitSystem(ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock);
VOID RtlpInitNlsTables(VOID);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: main.c,v 1.147 2003/01/15 19:58:07 chorns Exp $
/* $Id: main.c,v 1.148 2003/03/22 18:27:40 ekohl Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/main.c
@ -105,26 +105,6 @@ RtlpCheckFileNameExtension(PCHAR FileName,
}
static BOOLEAN
RtlpIsSystemHive(PCHAR FileName)
{
PCHAR Name;
Name = strrchr(FileName, '\\');
if (Name == NULL)
{
Name = FileName;
}
else
{
Name = Name + 1;
}
return((_stricmp(Name, "system.hiv") == 0) ||
(_stricmp(Name, "system") == 0));
}
static VOID
InitSystemSharedUserPage (PCSZ ParameterLine)
{
@ -499,22 +479,33 @@ ExpInitializeExecutive(VOID)
}
}
/* Pass 2: load registry chunks passed in */
/* Pass 2: import system registry chunk */
SetupBoot = TRUE;
for (i = 1; i < KeLoaderBlock.ModsCount; i++)
{
start = KeLoaderModules[i].ModStart;
length = KeLoaderModules[i].ModEnd - start;
name = (PCHAR)KeLoaderModules[i].String;
if (RtlpCheckFileNameExtension(name, "") ||
RtlpCheckFileNameExtension(name, ".hiv"))
{
CPRINT("Process registry chunk at %08lx\n", start);
CmImportHive((PCHAR)start, length);
}
if (RtlpIsSystemHive(name))
if (!_stricmp (name, "system") ||
!_stricmp (name, "system.hiv"))
{
CPRINT("Process 'system' registry chunk at %08lx\n", start);
SetupBoot = FALSE;
CmImportSystemHive((PCHAR)start, length);
}
}
/* Pass 3: import hardware registry chunk */
for (i = 1; i < KeLoaderBlock.ModsCount; i++)
{
start = KeLoaderModules[i].ModStart;
length = KeLoaderModules[i].ModEnd - start;
name = (PCHAR)KeLoaderModules[i].String;
if (!_stricmp (name, "hardware") ||
!_stricmp (name, "hardware.hiv"))
{
CPRINT("Process 'hardware' registry chunk at %08lx\n", start);
CmImportHardwareHive((PCHAR)start, length);
}
}
@ -533,7 +524,7 @@ ExpInitializeExecutive(VOID)
IoCreateDriverList();
/* Pass 3: process boot loaded drivers */
/* Pass 4: process boot loaded drivers */
BootDriverCount = 0;
for (i=1; i < KeLoaderBlock.ModsCount; i++)
{