https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e1b82b5b91473a8f92826…
commit e1b82b5b91473a8f92826ca54b8d0e6a84616fe2
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Fri Sep 21 15:37:34 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Fri Sep 21 15:37:34 2018 +0200
[NTOSKRNL] Create the 'Device Parameters' subkey and add the
'FirmwareIdentified' value for all ACPI-enumerated devices.
---
ntoskrnl/io/pnpmgr/pnpmgr.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 40 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c
index e0e040a1d7..5456b8aa68 100644
--- a/ntoskrnl/io/pnpmgr/pnpmgr.c
+++ b/ntoskrnl/io/pnpmgr/pnpmgr.c
@@ -1536,11 +1536,10 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
- HANDLE LogConfKey;
+ HANDLE LogConfKey, ControlKey, DeviceParamsKey;
ULONG ResCount;
ULONG ResultLength;
NTSTATUS Status;
- HANDLE ControlHandle;
DPRINT("IopSetDeviceInstanceData() called\n");
@@ -1619,10 +1618,46 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
InstanceKey,
NULL);
- Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL,
REG_OPTION_VOLATILE, NULL);
-
+ Status = ZwCreateKey(&ControlKey,
+ 0,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ REG_OPTION_VOLATILE,
+ NULL);
if (NT_SUCCESS(Status))
- ZwClose(ControlHandle);
+ ZwClose(ControlKey);
+
+ /* Create the 'Device Parameters' key and set the
'FirmwareIdentified' value for all ACPI-enumerated devices */
+ if (_wcsnicmp(DeviceNode->InstancePath.Buffer, L"ACPI\\", 5) == 0)
+ {
+ RtlInitUnicodeString(&KeyName, L"Device Parameters");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+ InstanceKey,
+ NULL);
+ Status = ZwCreateKey(&DeviceParamsKey,
+ 0,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ NULL);
+ if (NT_SUCCESS(Status))
+ {
+ ULONG FirmwareIdentified = 1;
+ RtlInitUnicodeString(&KeyName, L"FirmwareIdentified");
+ Status = ZwSetValueKey(DeviceParamsKey,
+ &KeyName,
+ 0,
+ REG_DWORD,
+ &FirmwareIdentified,
+ sizeof(FirmwareIdentified));
+
+ ZwClose(DeviceParamsKey);
+ }
+ }
DPRINT("IopSetDeviceInstanceData() done\n");