https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e2cb7b50b45e67575bcb44...
commit e2cb7b50b45e67575bcb44971425b3090e7a56f6 Author: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org AuthorDate: Fri Jun 2 15:37:56 2017 +0000 Commit: Hermès Bélusca-Maïto hermes.belusca-maito@reactos.org CommitDate: Thu Oct 25 00:40:00 2018 +0200
[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 --- ntoskrnl/config/i386/cmhardwr.c | 7 +------ ntoskrnl/config/powerpc/cmhardwr.c | 7 +------ ntoskrnl/io/pnpmgr/pnpinit.c | 11 ----------- ntoskrnl/io/pnpmgr/pnpmgr.c | 32 ++++++++++++++++++++------------ ntoskrnl/io/pnpmgr/pnpreport.c | 3 +-- 5 files changed, 23 insertions(+), 37 deletions(-)
diff --git a/ntoskrnl/config/i386/cmhardwr.c b/ntoskrnl/config/i386/cmhardwr.c index a19e58c259..b98c269100 100644 --- a/ntoskrnl/config/i386/cmhardwr.c +++ b/ntoskrnl/config/i386/cmhardwr.c @@ -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; diff --git a/ntoskrnl/config/powerpc/cmhardwr.c b/ntoskrnl/config/powerpc/cmhardwr.c index eed424149b..202a6d9f6b 100644 --- a/ntoskrnl/config/powerpc/cmhardwr.c +++ b/ntoskrnl/config/powerpc/cmhardwr.c @@ -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; diff --git a/ntoskrnl/io/pnpmgr/pnpinit.c b/ntoskrnl/io/pnpmgr/pnpinit.c index 57c844781e..5ae33e377f 100644 --- a/ntoskrnl/io/pnpmgr/pnpinit.c +++ b/ntoskrnl/io/pnpmgr/pnpinit.c @@ -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, diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 010a997b52..d6e181626b 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -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; diff --git a/ntoskrnl/io/pnpmgr/pnpreport.c b/ntoskrnl/io/pnpmgr/pnpreport.c index 00b3547cce..1ef595b682 100644 --- a/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/ntoskrnl/io/pnpmgr/pnpreport.c @@ -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;