mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 00:41:36 +00:00
[NTOS] Configuration Manager fixes.
- Rework CmpSetSystemValues() and remove its 1st-stage text-mode setup hack, since a real registry hive will be used for 1st-stage either. - Lock, then unlock the registry in NtInitializeRegistry when initializing the hives & flusher. - Call CmpInitializeHiveList() (i.e., initialize the other hives like \Software, \User, \.Default) only when we are not in setup-mode. svn path=/branches/setup_improvements/; revision=74747
This commit is contained in:
parent
e2cb7b50b4
commit
2ed65d1555
|
@ -262,8 +262,9 @@ CmpCmdInit(IN BOOLEAN SetupBoot)
|
||||||
/* Testing: Force Lazy Flushing */
|
/* Testing: Force Lazy Flushing */
|
||||||
CmpHoldLazyFlush = FALSE;
|
CmpHoldLazyFlush = FALSE;
|
||||||
|
|
||||||
/* Setup the hive list */
|
/* Setup the hive list if this is not a Setup boot */
|
||||||
CmpInitializeHiveList(SetupBoot);
|
if (!SetupBoot)
|
||||||
|
CmpInitializeHiveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
|
@ -396,10 +396,11 @@ NTAPI
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
||||||
UNICODE_STRING KeyName, ValueName = { 0, 0, NULL };
|
|
||||||
HANDLE KeyHandle = NULL;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
HANDLE KeyHandle;
|
||||||
|
UNICODE_STRING KeyName, ValueName = { 0, 0, NULL };
|
||||||
|
|
||||||
ASSERT(LoaderBlock != NULL);
|
ASSERT(LoaderBlock != NULL);
|
||||||
|
|
||||||
/* Setup attributes for loader options */
|
/* Setup attributes for loader options */
|
||||||
|
@ -412,9 +413,10 @@ CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
Status = NtOpenKey(&KeyHandle, KEY_WRITE, &ObjectAttributes);
|
Status = NtOpenKey(&KeyHandle, KEY_WRITE, &ObjectAttributes);
|
||||||
if (!NT_SUCCESS(Status)) goto Quickie;
|
if (!NT_SUCCESS(Status))
|
||||||
|
return Status;
|
||||||
|
|
||||||
/* Key opened, now write to the key */
|
/* Setup the value for the system start options */
|
||||||
RtlInitUnicodeString(&KeyName, L"SystemStartOptions");
|
RtlInitUnicodeString(&KeyName, L"SystemStartOptions");
|
||||||
Status = NtSetValueKey(KeyHandle,
|
Status = NtSetValueKey(KeyHandle,
|
||||||
&KeyName,
|
&KeyName,
|
||||||
|
@ -422,9 +424,10 @@ CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
CmpLoadOptions.Buffer,
|
CmpLoadOptions.Buffer,
|
||||||
CmpLoadOptions.Length);
|
CmpLoadOptions.Length);
|
||||||
if (!NT_SUCCESS(Status)) goto Quickie;
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto Quit;
|
||||||
|
|
||||||
/* Setup value name for system boot device in ARC format */
|
/* Setup the value for the system boot device in ARC format */
|
||||||
RtlInitUnicodeString(&KeyName, L"SystemBootDevice");
|
RtlInitUnicodeString(&KeyName, L"SystemBootDevice");
|
||||||
RtlCreateUnicodeStringFromAsciiz(&ValueName, LoaderBlock->ArcBootDeviceName);
|
RtlCreateUnicodeStringFromAsciiz(&ValueName, LoaderBlock->ArcBootDeviceName);
|
||||||
Status = NtSetValueKey(KeyHandle,
|
Status = NtSetValueKey(KeyHandle,
|
||||||
|
@ -434,15 +437,13 @@ CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
ValueName.Buffer,
|
ValueName.Buffer,
|
||||||
ValueName.Length);
|
ValueName.Length);
|
||||||
|
|
||||||
Quickie:
|
/* Free the temporary string */
|
||||||
/* Free the buffers */
|
|
||||||
RtlFreeUnicodeString(&ValueName);
|
RtlFreeUnicodeString(&ValueName);
|
||||||
|
|
||||||
|
Quit:
|
||||||
/* Close the key and return */
|
/* Close the key and return */
|
||||||
if (KeyHandle) NtClose(KeyHandle);
|
NtClose(KeyHandle);
|
||||||
|
return Status;
|
||||||
/* Return the status */
|
|
||||||
return (ExpInTextModeSetup ? STATUS_SUCCESS : Status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -1409,7 +1410,7 @@ CmpLoadHiveThread(IN PVOID StartContext)
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpInitializeHiveList(IN USHORT Flag)
|
CmpInitializeHiveList(VOID)
|
||||||
{
|
{
|
||||||
WCHAR FileBuffer[MAX_PATH], RegBuffer[MAX_PATH], ConfigPath[MAX_PATH];
|
WCHAR FileBuffer[MAX_PATH], RegBuffer[MAX_PATH], ConfigPath[MAX_PATH];
|
||||||
UNICODE_STRING TempName, FileName, RegName;
|
UNICODE_STRING TempName, FileName, RegName;
|
||||||
|
|
|
@ -1302,7 +1302,8 @@ NtInitializeRegistry(IN USHORT Flag)
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Always do this as kernel mode */
|
/* Always do this as kernel mode */
|
||||||
if (KeGetPreviousMode() == UserMode) return ZwInitializeRegistry(Flag);
|
if (KeGetPreviousMode() == UserMode)
|
||||||
|
return ZwInitializeRegistry(Flag);
|
||||||
|
|
||||||
/* Enough of the system has booted by now */
|
/* Enough of the system has booted by now */
|
||||||
Ki386PerfEnd();
|
Ki386PerfEnd();
|
||||||
|
@ -1344,8 +1345,8 @@ NtInitializeRegistry(IN USHORT Flag)
|
||||||
if (!CmFirstTime) return STATUS_ACCESS_DENIED;
|
if (!CmFirstTime) return STATUS_ACCESS_DENIED;
|
||||||
CmFirstTime = FALSE;
|
CmFirstTime = FALSE;
|
||||||
|
|
||||||
/* Acquire registry lock */
|
/* Lock the registry exclusively */
|
||||||
//CmpLockRegistryExclusive();
|
CmpLockRegistryExclusive();
|
||||||
|
|
||||||
/* Initialize the hives and lazy flusher */
|
/* Initialize the hives and lazy flusher */
|
||||||
CmpCmdInit(SetupBoot);
|
CmpCmdInit(SetupBoot);
|
||||||
|
@ -1354,7 +1355,7 @@ NtInitializeRegistry(IN USHORT Flag)
|
||||||
CmpSetVersionData();
|
CmpSetVersionData();
|
||||||
|
|
||||||
/* Release the registry lock */
|
/* Release the registry lock */
|
||||||
//CmpUnlockRegistry();
|
CmpUnlockRegistry();
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -963,7 +963,8 @@ ExpInitializeExecutive(IN ULONG Cpu,
|
||||||
if (LoaderBlock->SetupLdrBlock)
|
if (LoaderBlock->SetupLdrBlock)
|
||||||
{
|
{
|
||||||
/* Check if this is text-mode setup */
|
/* Check if this is text-mode setup */
|
||||||
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_TEXT_MODE) ExpInTextModeSetup = TRUE;
|
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_TEXT_MODE)
|
||||||
|
ExpInTextModeSetup = TRUE;
|
||||||
|
|
||||||
/* Check if this is network boot */
|
/* Check if this is network boot */
|
||||||
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_REMOTE_BOOT)
|
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_REMOTE_BOOT)
|
||||||
|
|
|
@ -859,7 +859,7 @@ CmpInitHiveFromFile(
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpInitializeHiveList(
|
CmpInitializeHiveList(
|
||||||
IN USHORT Flag
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue