From 5dc56dd1d67c95dd52a3cf9803e24b0a0b3ca69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 8 Dec 2021 18:36:34 +0100 Subject: [PATCH] Revert "[VIDEOPRT] Fix updating of new registry path values" This reverts commit ecf3416f492c4b664586de89bc36f831437fe23f. This commit was meant to fix CORE-17688. While its effectively fixed the problem, it introduced another regression CORE-17719. In the mean time, commit c05a45e17eda057d8b92ba76feecf3532d8324c1 fixed things properly. CORE-17719 --- win32ss/drivers/videoprt/registry.c | 62 ++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/win32ss/drivers/videoprt/registry.c b/win32ss/drivers/videoprt/registry.c index 4fed31e451d..f5d7f4084b1 100644 --- a/win32ss/drivers/videoprt/registry.c +++ b/win32ss/drivers/videoprt/registry.c @@ -557,42 +557,42 @@ IntCreateNewRegistryPath( ERR_(VIDEOPRT, "Failed create key '%wZ'\n", &DeviceExtension->NewRegistryPath); return Status; } - } - /* Open the new key */ - InitializeObjectAttributes(&ObjectAttributes, - &DeviceExtension->NewRegistryPath, - OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, - NULL, - NULL); - Status = ZwOpenKey(&NewKey, KEY_READ, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status); - return Status; - } + /* Open the new key */ + InitializeObjectAttributes(&ObjectAttributes, + &DeviceExtension->NewRegistryPath, + OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenKey(&NewKey, KEY_READ, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status); + return Status; + } - /* Open the device profile key */ - InitializeObjectAttributes(&ObjectAttributes, - &DeviceExtension->RegistryPath, - OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, - NULL, - NULL); - Status = ZwOpenKey(&SettingsKey, KEY_READ, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status); + /* Open the device profile key */ + InitializeObjectAttributes(&ObjectAttributes, + &DeviceExtension->RegistryPath, + OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = ZwOpenKey(&SettingsKey, KEY_READ, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status); + ObCloseHandle(NewKey, KernelMode); + return Status; + } + + /* Copy the registry data from the legacy key */ + Status = IntCopyRegistryKey(SettingsKey, NewKey); + + /* Close the key handles */ + ObCloseHandle(SettingsKey, KernelMode); ObCloseHandle(NewKey, KernelMode); - return Status; } - /* Copy the registry data from the legacy key */ - Status = IntCopyRegistryKey(SettingsKey, NewKey); - - /* Close the key handles */ - ObCloseHandle(SettingsKey, KernelMode); - ObCloseHandle(NewKey, KernelMode); - return Status; }