[SETUPLIB] Upgrade display settings even if no hardware profile exists

This commit is contained in:
Hervé Poussineau 2021-12-27 14:17:45 +01:00
parent a6bf77e7b9
commit cdae92ed8c

View file

@ -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);