https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ecf3416f492c4b664586d…
commit ecf3416f492c4b664586de89bc36f831437fe23f
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Thu Jul 22 16:13:38 2021 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Tue Jul 27 14:44:14 2021 +0200
[VIDEOPRT] Fix updating of new registry path values
CORE-17688
When a new driver is installed for the same device (like VBoxVideo), it uses the same
hardware enum registry key and thus reuses the same DisplayId and the same display
registry key. Therefore we need to update the setting in that key, even when the key
already exists.
This seems to work good and not cause any issues, but testing indicated that on
Windows some values are only updated, when the driver has changed. If neccessary, this can
be achieved by updating and querying the ActiveService value in the device enum key (e.g.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_80EE&DEV_BEEF&SUSYS_00000000&REV_00\3&267a616a&0&10\Control:
ActiveService). If that doesn't match the current device name (from
DriverExtension->RegistryPath) the values [...]
---
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 8d43b32edab..5a0f96c719f 100644
--- a/win32ss/drivers/videoprt/registry.c
+++ b/win32ss/drivers/videoprt/registry.c
@@ -498,42 +498,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 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);
+ /* 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;
+ }
- /* Close the key handles */
- ObCloseHandle(SettingsKey, KernelMode);
+ /* 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;
}