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;
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e2a8585edc0883408dd10…
commit e2a8585edc0883408dd10778228e6c66d44c5876
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sun Jul 25 18:02:32 2021 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sun Jul 25 18:02:32 2021 +0200
[NTOS:SE] Remove redundant commented call on token duplication
When duplicating an access token, the authentication ID is already copied from the existing token to the new one anyway so there's no point on having the commented call still left in the code.
---
ntoskrnl/se/token.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ntoskrnl/se/token.c b/ntoskrnl/se/token.c
index 507a8d73bad..a7b004ae034 100644
--- a/ntoskrnl/se/token.c
+++ b/ntoskrnl/se/token.c
@@ -854,8 +854,7 @@ SepDuplicateToken(
AccessToken->TokenFlags = Token->TokenFlags & ~TOKEN_SESSION_NOT_REFERENCED;
- /* Copy and reference the logon session */
- // RtlCopyLuid(&AccessToken->AuthenticationId, &Token->AuthenticationId);
+ /* Reference the logon session */
Status = SepRmReferenceLogonSession(&AccessToken->AuthenticationId);
if (!NT_SUCCESS(Status))
{