From cdae92ed8cdb159985c66d291600998a5f322dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 27 Dec 2021 14:17:45 +0100 Subject: [PATCH] [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);