https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40b9ee0ae0a43ec963e5c…
commit 40b9ee0ae0a43ec963e5c41e6fce0a037e904c20
Author:     Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Thu Jan 6 02:04:09 2022 +0100
Commit:     GitHub <noreply(a)github.com>
CommitDate: Thu Jan 6 04:04:09 2022 +0300
    [VIDEOPRT] Match Zw*Key() DesiredAccess values (#4145)
    Even if the kernel mode does not care, this makes it clear.
---
 win32ss/drivers/videoprt/registry.c | 4 ++--
 win32ss/drivers/videoprt/videoprt.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/win32ss/drivers/videoprt/registry.c b/win32ss/drivers/videoprt/registry.c
index f5d7f4084b1..76b3ead0846 100644
--- a/win32ss/drivers/videoprt/registry.c
+++ b/win32ss/drivers/videoprt/registry.c
@@ -339,7 +339,7 @@ IntSetupDeviceSettingsKey(
                                OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
                                NULL,
                                NULL);
-    Status = ZwOpenKey(&SourceKeyHandle, KEY_WRITE, &ObjectAttributes);
+    Status = ZwOpenKey(&SourceKeyHandle, KEY_READ, &ObjectAttributes);
     if (Status != STATUS_SUCCESS)
     {
         ERR_(VIDEOPRT, "ZwOpenKey failed for settings key: status 0x%lx\n",
Status);
@@ -564,7 +564,7 @@ IntCreateNewRegistryPath(
                                    OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE,
                                    NULL,
                                    NULL);
-        Status = ZwOpenKey(&NewKey, KEY_READ, &ObjectAttributes);
+        Status = ZwOpenKey(&NewKey, KEY_WRITE, &ObjectAttributes);
         if (!NT_SUCCESS(Status))
         {
             ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n",
Status);
diff --git a/win32ss/drivers/videoprt/videoprt.c b/win32ss/drivers/videoprt/videoprt.c
index 35580904a7b..6f94d2a788d 100644
--- a/win32ss/drivers/videoprt/videoprt.c
+++ b/win32ss/drivers/videoprt/videoprt.c
@@ -617,7 +617,7 @@ IntLoadRegistryParameters(VOID)
                                    NULL);
         Status = ZwCreateKey(&KeyHandle,
-                             KEY_WRITE,
+                             READ_CONTROL, // Non-0 placeholder: no use for this handle.
                              &ObjectAttributes,
                              0,
                              NULL,