[NTOS] Remove some hacks that are not needed anymore, since a real registry hive will be used in 1st-stage as well.

This reverts a7c26408 (r53255) and ff75ae1b (r53694), and a hack from 6075ae9a (r46690).

svn path=/branches/setup_improvements/; revision=74745
svn path=/branches/setup_improvements/; revision=74746
This commit is contained in:
Hermès Bélusca-Maïto 2017-06-02 15:37:56 +00:00
parent c83ac7600d
commit e2cb7b50b4
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
5 changed files with 23 additions and 37 deletions

View file

@ -401,12 +401,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
NULL,
REG_OPTION_NON_VOLATILE,
&Disposition);
if (ExpInTextModeSetup)
{
if (!NT_SUCCESS(Status))
BiosHandle = NULL;
}
else if (!NT_SUCCESS(Status))
if (!NT_SUCCESS(Status))
{
NtClose(SystemHandle);
return Status;

View file

@ -306,12 +306,7 @@ CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBloc
NULL,
REG_OPTION_NON_VOLATILE,
&Disposition);
if (ExpInTextModeSetup)
{
if (!NT_SUCCESS(Status))
BiosHandle = NULL;
}
else if (!NT_SUCCESS(Status))
if (!NT_SUCCESS(Status))
{
NtClose(SystemHandle);
return Status;

View file

@ -56,17 +56,6 @@ PiInitCacheGroupInformation(VOID)
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet"
L"\\Control\\ServiceGroupOrder");
/* ReactOS HACK for SETUPLDR */
if (KeLoaderBlock->SetupLdrBlock)
{
DPRINT1("WARNING!! In PiInitCacheGroupInformation, using ReactOS HACK for SETUPLDR!!\n");
/* Bogus data */
PiInitGroupOrderTableCount = 0;
PiInitGroupOrderTable = (PVOID)(ULONG_PTR)0xBABEB00BBABEB00BULL;
return STATUS_SUCCESS;
}
/* Open the registry key */
Status = IopOpenRegistryKeyEx(&KeyHandle,
NULL,

View file

@ -23,7 +23,6 @@ RTL_AVL_TABLE PpDeviceReferenceTable;
extern ERESOURCE IopDriverLoadResource;
extern ULONG ExpInitializationPhase;
extern BOOLEAN ExpInTextModeSetup;
extern BOOLEAN PnpSystemInit;
#define MAX_DEVICE_ID_LEN 200
@ -812,7 +811,13 @@ IopStartDevice(
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
InstanceHandle,
NULL);
Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
Status = ZwCreateKey(&ControlHandle,
KEY_SET_VALUE,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE,
NULL);
if (!NT_SUCCESS(Status))
goto ByeBye;
@ -1458,10 +1463,6 @@ IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
/* Assume failure */
*Handle = NULL;
/* Create a volatile device tree in 1st stage so we have a clean slate
* for enumeration using the correct HAL (chosen in 1st stage setup) */
if (ExpInTextModeSetup) CreateOptions |= REG_OPTION_VOLATILE;
/* Open root key for device instances */
Status = IopOpenRegistryKeyEx(&hParent, NULL, &EnumU, KEY_CREATE_SUB_KEY);
if (!NT_SUCCESS(Status))
@ -1555,6 +1556,8 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
&ObjectAttributes,
0,
NULL,
// FIXME? In r53694 it was silently turned from non-volatile into this,
// without any extra warning. Is this still needed??
REG_OPTION_VOLATILE,
NULL);
if (NT_SUCCESS(Status))
@ -3267,7 +3270,7 @@ IopEnumerateDetectedDevices(
&ObjectAttributes,
0,
NULL,
ExpInTextModeSetup ? REG_OPTION_VOLATILE : 0,
REG_OPTION_NON_VOLATILE,
NULL);
if (!NT_SUCCESS(Status))
{
@ -3283,7 +3286,7 @@ IopEnumerateDetectedDevices(
&ObjectAttributes,
0,
NULL,
ExpInTextModeSetup ? REG_OPTION_VOLATILE : 0,
REG_OPTION_NON_VOLATILE,
NULL);
ZwClose(hLevel1Key);
if (!NT_SUCCESS(Status))
@ -3461,7 +3464,7 @@ IopUpdateRootKey(VOID)
NTSTATUS Status;
InitializeObjectAttributes(&ObjectAttributes, &EnumU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, NULL, NULL);
Status = ZwCreateKey(&hEnum, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
Status = ZwCreateKey(&hEnum, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("ZwCreateKey() failed with status 0x%08lx\n", Status);
@ -3469,7 +3472,7 @@ IopUpdateRootKey(VOID)
}
InitializeObjectAttributes(&ObjectAttributes, &RootPathU, OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, hEnum, NULL);
Status = ZwCreateKey(&hRoot, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, 0, NULL);
Status = ZwCreateKey(&hRoot, KEY_CREATE_SUB_KEY, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, NULL);
ZwClose(hEnum);
if (!NT_SUCCESS(Status))
{
@ -4538,8 +4541,13 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
*DevInstRegKey,
NULL);
Status = ZwCreateKey(DevInstRegKey, DesiredAccess, &ObjectAttributes,
0, NULL, ExpInTextModeSetup ? REG_OPTION_VOLATILE : 0, NULL);
Status = ZwCreateKey(DevInstRegKey,
DesiredAccess,
&ObjectAttributes,
0,
NULL,
REG_OPTION_NON_VOLATILE,
NULL);
ZwClose(ObjectAttributes.RootDirectory);
return Status;

View file

@ -284,8 +284,7 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
/* Open a handle to the instance path key */
/* REG_OPTION_VOLATILE is a HACK!!! */
Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_VOLATILE, &InstanceKey);
Status = IopCreateDeviceKeyPath(&DeviceNode->InstancePath, REG_OPTION_NON_VOLATILE, &InstanceKey);
if (!NT_SUCCESS(Status))
return Status;