https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cdae92ed8cdb159985c66…
commit cdae92ed8cdb159985c66d291600998a5f322dc0
Author:     Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Mon Dec 27 14:17:45 2021 +0100
Commit:     Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Jan 6 17:45:03 2022 +0100
    [SETUPLIB] Upgrade display settings even if no hardware profile exists
---
 base/setup/lib/settings.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/base/setup/lib/settings.c b/base/setup/lib/settings.c
index f958d846960..d392511dd2e 100644
--- a/base/setup/lib/settings.c
+++ b/base/setup/lib/settings.c
@@ -894,6 +894,17 @@ ProcessDisplayRegistry(
     Status = NtOpenKey(&KeyHandle,
                        KEY_SET_VALUE,
                        &ObjectAttributes);
+    if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
+    {
+        /* Try without Hardware Profile part */
+        RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
+
L"System\\CurrentControlSet\\Services\\%s\\Device0",
+                            ServiceName);
+        RtlInitUnicodeString(&KeyName, RegPath);
+        Status = NtOpenKey(&KeyHandle,
+                           KEY_SET_VALUE,
+                           &ObjectAttributes);
+    }
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);