summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e2cb7b5)
- 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
/* Testing: Force Lazy Flushing */
CmpHoldLazyFlush = FALSE;
/* Testing: Force Lazy Flushing */
CmpHoldLazyFlush = FALSE;
- /* Setup the hive list */
- CmpInitializeHiveList(SetupBoot);
+ /* Setup the hive list if this is not a Setup boot */
+ if (!SetupBoot)
+ CmpInitializeHiveList();
INIT_FUNCTION
CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
INIT_FUNCTION
CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
OBJECT_ATTRIBUTES ObjectAttributes;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName, ValueName = { 0, 0, NULL };
UNICODE_STRING KeyName, ValueName = { 0, 0, NULL };
- HANDLE KeyHandle = NULL;
- NTSTATUS Status;
ASSERT(LoaderBlock != NULL);
/* Setup attributes for loader options */
ASSERT(LoaderBlock != NULL);
/* Setup attributes for loader options */
NULL,
NULL);
Status = NtOpenKey(&KeyHandle, KEY_WRITE, &ObjectAttributes);
NULL,
NULL);
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");
Status = NtSetValueKey(KeyHandle,
&KeyName,
RtlInitUnicodeString(&KeyName, L"SystemStartOptions");
Status = NtSetValueKey(KeyHandle,
&KeyName,
REG_SZ,
CmpLoadOptions.Buffer,
CmpLoadOptions.Length);
REG_SZ,
CmpLoadOptions.Buffer,
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");
RtlCreateUnicodeStringFromAsciiz(&ValueName, LoaderBlock->ArcBootDeviceName);
Status = NtSetValueKey(KeyHandle,
RtlInitUnicodeString(&KeyName, L"SystemBootDevice");
RtlCreateUnicodeStringFromAsciiz(&ValueName, LoaderBlock->ArcBootDeviceName);
Status = NtSetValueKey(KeyHandle,
ValueName.Buffer,
ValueName.Length);
ValueName.Buffer,
ValueName.Length);
-Quickie:
- /* Free the buffers */
+ /* Free the temporary string */
RtlFreeUnicodeString(&ValueName);
RtlFreeUnicodeString(&ValueName);
/* Close the key and return */
/* Close the key and return */
- if (KeyHandle) NtClose(KeyHandle);
-
- /* Return the status */
- return (ExpInTextModeSetup ? STATUS_SUCCESS : Status);
+ NtClose(KeyHandle);
+ return Status;
-CmpInitializeHiveList(IN USHORT Flag)
+CmpInitializeHiveList(VOID)
{
WCHAR FileBuffer[MAX_PATH], RegBuffer[MAX_PATH], ConfigPath[MAX_PATH];
UNICODE_STRING TempName, FileName, RegName;
{
WCHAR FileBuffer[MAX_PATH], RegBuffer[MAX_PATH], ConfigPath[MAX_PATH];
UNICODE_STRING TempName, FileName, RegName;
PAGED_CODE();
/* Always do this as kernel mode */
PAGED_CODE();
/* 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 */
Ki386PerfEnd();
/* Enough of the system has booted by now */
Ki386PerfEnd();
if (!CmFirstTime) return STATUS_ACCESS_DENIED;
CmFirstTime = FALSE;
if (!CmFirstTime) return STATUS_ACCESS_DENIED;
CmFirstTime = FALSE;
- /* Acquire registry lock */
- //CmpLockRegistryExclusive();
+ /* Lock the registry exclusively */
+ CmpLockRegistryExclusive();
/* Initialize the hives and lazy flusher */
CmpCmdInit(SetupBoot);
/* Initialize the hives and lazy flusher */
CmpCmdInit(SetupBoot);
CmpSetVersionData();
/* Release the registry lock */
CmpSetVersionData();
/* Release the registry lock */
if (LoaderBlock->SetupLdrBlock)
{
/* Check if this is text-mode setup */
if (LoaderBlock->SetupLdrBlock)
{
/* 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 */
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_REMOTE_BOOT)
/* Check if this is network boot */
if (LoaderBlock->SetupLdrBlock->Flags & SETUPLDR_REMOTE_BOOT)
VOID
NTAPI
CmpInitializeHiveList(
VOID
NTAPI
CmpInitializeHiveList(